I have just been asked to tet out CETE software for our PDF reports and one of our concerns is that we don't want to dynamically create every PDF report. Is it possible to use a report for the static information and then create the PDF in the code behind? Basically I want to lay out everything and then just bind everything from the codebehind.
Thanks,
Terry
Creating the report
Re: Creating the report
Support · Feb 11, 2008Hello Terry,
You can create the PDF reports easily by using the ReportWriter product. Using the Report Designer product you can create a Report Template (.dplx) file and you can use this template file to generate the report. This will be useful if your data is coming from a database. You can also use the data coming from any objects of your program.
You can also generate the PDF documents using the Generator product. You can add any page element to the PDF document without any problem. Here your total report will be generated dynamically.
Also you can create a PDF template by using the Generator product and you can fill the fields with the data by using the Merger product without any problem. You can add any new contents to existing PDF by using the Merger.
Please feel free to download the fully functional Evaluation version of our product DynamicPDF for .NET
.
Thanks,
ceTe Software Support Team.
Re: Creating the report
Forum member · Feb 11, 2008Thanks for the reply.
From the sounds of your reply it is looking like we will have to use a combination of the report writer and the merger. We can create the report .dplx file with everything we want on it and then merge our information to that? Do you have any simple examples of something like this? From the merger examples I have seen they are merging to a PDF file not a .dplx file.
Thanks,
Terry Cisco
Re: Creating the report
Support · Feb 11, 2008Hello Terry,
You can not merge a .dplx file. Dplx file is the file which represents the layout of the report. You will have to use this file in the ReportWriter product and this generates the PDF report using the dplx file. This will use the data from the database and you do not have to take care of the overflow of the data.
If you want to fill the existing PDF with the data then you will have to create a PDF template using the Generator product and then you can fill or add the data to the generated template using the Merger.
You can refer to the ReportWriter, Merger, and Generator examples downloaded with the product download.
You can also refer to our help documentaion
.
Thanks,
ceTe Software Support Team.
Re: Creating the report
Forum member · Feb 11, 2008I think this is more to what I was referring to:
http://www.DynamicPDF.com/Forums/DisplayThread.csp?ForumID=14&ThreadID=935#3060
I want to create the dplx file and then fill everything in from the codebehind.
Examples..... There is nothing like this in the examples provided in the download.
Thanks again,
Terry Cisco
Re: Creating the report
Support · Feb 11, 2008Hello Terry,
In order to create a PDF report using the ReportWriter product you will have to create a dplx file. You can refer to the help documentation of the designer
for this.
Then you will have to use this dplx file in the ReportWriter. Following is the sample code for this if you do not inherit from the DplxWebForm.
DocumentLayout layout = new DocumentLayout(@"C:\Temp\layout.dplx");
Document document = layout.Run();
document.DrawToWeb();
You can refer to the Using Dplx files
topic on our help documentation.
Thanks,
ceTe Software Support Team.
Re: Creating the report
Forum member · Feb 11, 2008That is fine but I want to set the query in the codebehind and not in the .dplx file. Is this possible. I am using system.web.ui.page.
Re: Creating the report
Support · Feb 11, 2008Hello Terry,
Yes, it is possible to set the query in the code than in the designer. You will have to set the query as EventDriven in the designer and in the OpeningRecordSet event of the Query object you can set the query. You can refer to the EventDrivenQueries
topic on our help documentaion.
Thanks,
ceTe Software Support Team.
Re: Creating the report
Forum member · Feb 11, 2008How do I set the subreport sql in the codebehind?
Re: Creating the report
Support · Feb 11, 2008Hello,
Following is the sample code block that shows how to set the query of the Sub Report from code behind:
SubReport rp = (SubReport) e.LayoutWriter.DocumentLayout.GetElementById("SubReport1");
rp.Query.OpeningRecordSet +=new OpeningRecordSetEventHandler(Query_OpeningSubRecordSet);
private void Query_OpeningSubRecordSet( object sender, OpeningRecordSetEventArgs e )
{
Query query = (Query)sender;
SqlConnection connection = new SqlConnection( query.ConnectionString );
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter( "select * from Customers" , connection );
DataSet ds = new DataSet();
sqlDataAdapter.Fill( ds.Tables.Add("1") );
e.RecordSet = new DataTableRecordSet( connection, ds.Tables["1"] );
}
Thanks,
ceTe Software Support Team