Print Page | Close Window

DrawTableRows not able to write all the rows.

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3789
Printed Date: 19 Apr 24 at 6:56PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DrawTableRows not able to write all the rows.
Posted By: MFuser
Subject: DrawTableRows not able to write all the rows.
Date Posted: 28 Feb 20 at 9:06AM
Hi,
I followed one of the example to write the table rows in the pdf
http://www.quickpdf.org/forum/create-table-exactly-like-this-sample_topic1907.html" rel="nofollow - http://www.quickpdf.org/forum/create-table-exactly-like-this-sample_topic1907.html

When my rows are exceeding over 100 or say 400 rows the DrawTableRows is only able to write upto the 42 rows only even when I tired to increase the height.
Here's is my sample code
  qp.SetPageSize("A4");

                    var numberofPropertiesasColumn = 5;
                    var numberofFaxFecords = 400 + 1;                   
                    // Create the table and specify the number of rows and columns
                    var tableId = qp.CreateTable(numberofFaxFecords, numberofPropertiesasColumn);
                    // Specify color and width of borders
                    qp.SetTableBorderColor(tableId, 0, 0.3, 0.204, 0);
                    qp.SetTableBorderWidth(tableId, 0, 0.2);
                    // Specify table row height and table column width
                    qp.SetTableRowHeight(tableId, 1, 5, 0);
                    qp.SetTableColumnWidth(tableId, 1, 1, 50);
                    qp.SetTableColumnWidth(tableId, 2, 2, 100);
                    qp.SetTableColumnWidth(tableId, 3, 3, 200);
                    qp.SetTableColumnWidth(tableId, 4, 5, 100);
                    // Specify a background color for the column headers
                    // QP.SetTableCellBackgroundColor(tableID, 1, 1, 1, 5, 0.3, 0.7, 1.0);
                    qp.SetTableCellAlignment(tableId, 1, 1, 1, 5, 4);
                    var rows = 1;
                    qp.SetTableCellContent(tableId, rows, 1, "<b>TestID</b>");
                    qp.SetTableCellContent(tableId, rows, 2,
                        "<b>Test FileName</b>");
                    qp.SetTableCellContent(tableId, rows, 3,
                        "<b>TestJob</b>");
                    qp.SetTableCellContent(tableId, rows, 4,
                        "<b>TestDate</b>");
                    qp.SetTableCellContent(tableId, rows, 5,
                        "<b>TestRes</b>");
                    for (int i = 0; i < 400; i++)
                    {
                        rows++;
                        qp.SetTableCellContent(tableId, rows, 1, "Value" + i.ToString());
                        qp.SetTableCellContent(tableId, rows, 2, "Value" + i.ToString());
                        qp.SetTableCellContent(tableId, rows, 3, "Value" + i.ToString());
                        qp.SetTableCellContent(tableId, rows, 4, "Value" + i.ToString());
                        qp.SetTableCellContent(tableId, rows, 5, "Value" + i.ToString());

                    }

                    qp.SetOrigin(1);
                    qp.DrawTableRows(tableId, 30, 60, 4000, 1, 0);
                    //Export report header details start here --
                    qp.SetTextSize(10);
                    qp.DrawText(380, 20, "Hellow World");
                    qp.DrawText(380, 35, DateTime.Now.ToString("dd/MM/yy"));
                    qp.DrawText(200, 50, "Hello World Reort");
                    // Save the document to disk
                    faxSavePdf = qp.SaveToFile(@"test111111.pdf");


Is there a way to handle or write all the rows ?
Thanks




Replies:
Posted By: tfrost
Date Posted: 29 Feb 20 at 10:56AM
I do not use this function myself, but it looks as if you are writing all the rows onto an A4 page but assuming that you wil have a space 4000 units high to do this. However all you will see will be whatever fits on the page, inside its clip rectangle. DrawTableRows will not add new pages to the PDF, nor do the pagination for you. You can use the firstrow and lastrow parameters, and the return value of the function, to help with this.





Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk