|
Rank: Newbie Groups: Member
Joined: 12/18/2010 Posts: 8
|
Hi
I have a project in VB.Net that is a report generator that prints dynamic reports to a windows printer. I am using EO.PDF to create PDF files instead.
I am trying to understand how to print rows and columns correctly, that is to align the columns. I also need to be able to draw vertical lines depending on the parameters selected. Basically the equivalent of an Excel spreadsheet.
Where can I find a working example of a VB program printing a multi-page report?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
With EO.PDF you can use an AcmTable to do that. You do not have to worry about mulit-page because EO.Pdf automatically pages for you (You can do manual paging by explicitly inserting AcmPageBreak in your content tree). There are multiple working samples in the demo project demonstring how to use an AcmTable:
1. All Demos -> Advanced Formatting -> Table; 2. All Demos -> Advanced Formatting -> Table - Advanced; 3. Low Level Content API -> Rubber Stamp
You can take a look of the source code of those samples to see how it works.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/18/2010 Posts: 8
|
Thanks - I had a look at that but I don't see how to dynamically define the variable number of columns, the example defines static columns of a predetermined width.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Everything is created by code so nothing is static. You dynamically create an AcmTable object with an array of columns. You pass in two columns you get two columns, you pass in three columns you get three columns. It's all in your control. The whole library is about dynamically creating PDF file in your code.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/18/2010 Posts: 8
|
Thanks - I have almost resolved the problem.
I am using the column span feature to merge 2 columns because the text content is too long for the one column and is truncated. How do I get the full text back into the merged cells?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The text should be automatically wrapped into multiple lines if a line break is possible. So you do not need to do anything special here. If you have a very very long unbreakable word, then you must break that word into multiple words so that it will be automatically wrapped into the next line.
If you do not have long unbreakable word and it still does not wrap lines, then please create a small piece of test code to demonstrate the problem. Make sure the test code runs independently and only contain the code needed to reproduce the problem. Once we have that we will try to run it here and see what we can find.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/18/2010 Posts: 8
|
Hi
Thanks - I have resolved the above problem with the table columns.
I am using the render.BeforeRenderPage and render.AfterRenderPage to process the page header and footer but when I have more than one page I am getting blank pages with header and footer and then the table with data on next page etc.
How does the automatic page break work? That is how do I handle the multiple pages and print the page header & footer correctly?
Also how do I position the table on the second page?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You usually do not position the table directly on the second page. When you have a big table on the first page, it automatically "flows" into next page.
BeforeRenderPage and AfterRenderPage should do page header and footer correctly for you on all pages because those two events are called for every page. If you have problem, please post test code and we will be happy to take a look.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/18/2010 Posts: 8
|
Hi Is there any way to repeat the table heading on the second page?
Regarding the positioning of the table. The report writer program that I am trying to convert to write to PDF has a typical report for a number of employees, where I have a page header and footer, then I have an employee header followed by employee details for each employee. What is the best way to build the report tree? Process and render each employee or process all employees and then render?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
There is no built in way to automatically repeat table heading on the second page. In fact the AcmTable object does not even distinguish "table header" or "table row". So you just create table rows.
Our tech support does not advice on implementation or assist you on anything that is particular related to your business logic. For example, we can tell you if you use AcmTable, you need to create table rows and if you have problem creating table rows, we can help you or point you to the right direction about creating table rows. However we will not be able to advice on what’s the best way for you to implementing your reporting/employee logic. Those are related to your business logic. The general rule is we support our product, not your project.
Thanks!
|
|