How to remove PageHeader PageFooter from Excel Report

67 views
Skip to first unread message

Williams

unread,
Dec 14, 2011, 11:26:16 AM12/14/11
to FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro
Hello Sergey

I have one report to show information in PDF and Excel format.
In the PDF the PageHeader and PageFooter its ok but in Excel I don´t
want it
I know I could have two versions of the same report, but is it
possible to use the same report for PDF and Excel removing the
PageHeader and PageFooter when I send it to Excel?

Thanks

Williams Pacheco

Spirin Sergey

unread,
Dec 14, 2011, 11:43:52 AM12/14/11
to FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro
Hello,

You do export in code or in the preview?

---
Sergey Spirin.
FastReport for Xbase-family languages,
http://www.spirins.com

Williams

unread,
Dec 15, 2011, 5:36:33 AM12/15/11
to FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro
Thanks Sergey

I do export from code

Spirin Sergey

unread,
Dec 15, 2011, 8:06:45 AM12/15/11
to FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro
Hello, Williams,

> I do export from code

Ok. At this case there is no problem. Fore example:

1. Add variable to report, for example cCurrentExport, give it
initial value, for example 'None'.
2. At your function:

IF (CurExport = "XLSExport") .or. (CurExport = "BIFFExport")
oFr:AddVariable("MyVars", "cCurrentExport", "'" + "XLSExport" +
"'")
oFr:DoExport(....)
ENDIF

3. And at BeforePrint-event of PageHeader:

procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);
begin
PageHeader1.Visible := (<cCurrentExport> <> 'XLSExport') and
(<cCurrentExport> <> 'BIFFExport');
end;


Of course, you can do not add variable but read it from your
application with GetHbVar() etc.

---
Sergey Spirin.
FastReport for Xbase-family languages,
http://www.spirins.com

Williams

unread,
Dec 15, 2011, 11:28:31 AM12/15/11
to FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro
Great Sergey

It´s works!
Now I want to disable the cell filled.
Right now it´s white but I want the default Excel filled (No Fill)

Thanks again

Regards

Williams Pacheco

Spirin Sergey

unread,
Dec 15, 2011, 1:14:34 PM12/15/11
to FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro
Hello, Williams again,


> Now I want to disable the cell filled.
> Right now it´s white but I want the default Excel filled (No Fill)

What? Sorry I do not understand you, please, a litle bit more in
detail. And I begin suspect that you have something another than I
advised :))

--- Sergey Spirin. FastReport for Xbase-family languages,  http://
www.spirins.com

Williams

unread,
Dec 15, 2011, 3:21:50 PM12/15/11
to FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro
Ok sorry Sergey

I will explain better in a new post related to MS Excel

Thanks

Williams Pacheco

Reply all
Reply to author
Forward
0 new messages