I want to generate a report from my webpage, I used table to containe the data, but data is normally printing on two three pages. now i need a same header of the table appear in the next page, when printing on more than one page. also how i can implemenet
the footer if i want to write company address and other information.
please any suggestion link, if someone explain with code, i am very thankful
Ok, what you can do is store header and footer information in a table in the database and then you simply do a database call to place the text from the database into the header and footer as needed.
I'm exporting my reports to an excel xml file. I've got the xml marked up so that it repeats the header at the begining of every page.
This system has worked great for me because all of my users have MS Excel. I can control the size, layout ect, so the export to XML not only works to give the user data in a spreadsheet format, but it's also very printer friendly.
If your users for this report have the ability to view an excel document in xml format I'd be happy to share my code with you.
This works great on my Intranet because I know the applications my users are using. I don't think I would use this process if the page was public, since many users will not the ability to open an xml file intended for excel.
Actually normally user need the report just see few values. but they also want to print the report. because might be they need to send the report to the customer.
How i know when the page finished and when new page started.
With the XML document I create you don't need to know when a new page is created. You just tell the document to repeat header values on every page when it prints and the XML doc handles the rest. If your users are using Excel this will work fine, if they're
not using Excel, it won't work so well.
shahid.majee...
Member
620 Points
546 Posts
how we can print same header and footer if we write up on multiple pages
May 02, 2012 06:21 PM|LINK
Hello,
I want to generate a report from my webpage, I used table to containe the data, but data is normally printing on two three pages. now i need a same header of the table appear in the next page, when printing on more than one page. also how i can implemenet the footer if i want to write company address and other information.
please any suggestion link, if someone explain with code, i am very thankful
Thanks in advance.
Shahid Majeed
Email: shahid.majeed@gmail.com
bbcompent1
All-Star
32996 Points
8510 Posts
Moderator
Re: how we can print same header and footer if we write up on multiple pages
May 02, 2012 08:05 PM|LINK
Ok, what you can do is store header and footer information in a table in the database and then you simply do a database call to place the text from the database into the header and footer as needed.
Loganix77
Participant
1351 Points
412 Posts
Re: how we can print same header and footer if we write up on multiple pages
May 02, 2012 08:16 PM|LINK
Hey Shahid,
I'm exporting my reports to an excel xml file. I've got the xml marked up so that it repeats the header at the begining of every page.
This system has worked great for me because all of my users have MS Excel. I can control the size, layout ect, so the export to XML not only works to give the user data in a spreadsheet format, but it's also very printer friendly.
If your users for this report have the ability to view an excel document in xml format I'd be happy to share my code with you.
This works great on my Intranet because I know the applications my users are using. I don't think I would use this process if the page was public, since many users will not the ability to open an xml file intended for excel.
shahid.majee...
Member
620 Points
546 Posts
Re: how we can print same header and footer if we write up on multiple pages
May 02, 2012 09:10 PM|LINK
How i know when the page finished and when new page started.
Shahid Majeed
Email: shahid.majeed@gmail.com
shahid.majee...
Member
620 Points
546 Posts
Re: how we can print same header and footer if we write up on multiple pages
May 02, 2012 09:13 PM|LINK
Actually normally user need the report just see few values. but they also want to print the report. because might be they need to send the report to the customer.
Shahid Majeed
Email: shahid.majeed@gmail.com
Loganix77
Participant
1351 Points
412 Posts
Re: how we can print same header and footer if we write up on multiple pages
May 03, 2012 02:08 PM|LINK
With the XML document I create you don't need to know when a new page is created. You just tell the document to repeat header values on every page when it prints and the XML doc handles the rest. If your users are using Excel this will work fine, if they're not using Excel, it won't work so well.
Here's where I start the xml doc:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<LastAuthor>ME</LastAuthor>
<Created>2008-05-15T19:14:19Z</Created>
<Version>11.9999</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>9210</WindowHeight>
<WindowWidth>19035</WindowWidth>
<WindowTopX>0</WindowTopX>
<WindowTopY>90</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
Then My styles (which I'm omitting because they're not relevant.
Now my print information:
<Worksheet ss:Name="ARTargetAccounts">
<Names> <NamedRange ss:Name="Print_Titles" ss:RefersTo="=ARTargetAccounts!R1"/> </Names>
By telling the XML document to print the titles for row1 it handles placing the headers on the top of every page that is printed.