conditional subreport

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  conditional subreport

DynamicPDF CoreSuite for .NET (v10) Forum

 Feb 06 2020 3:50 AM
Hi
my requirement it just like hide or show some column of controll base on my condition
like
i have 3 subreport want to hide and show base of by condition from c#
 Feb 06 2020 9:15 AM
Posted by a ceTe Software moderator
Hello,

You can dynamically suppress the layout of a specific element using the LayingOut event. You can set the the Layout property (Boolean) of the LayingOutEventArgs object to false. DynamicPDF ReportWriter does not support hiding a specific sub report dynamically.

Thanks,
ceTe Software Support Team
 Feb 07 2020 3:17 AM
Thanks for reply,
Senario is that i have draw one table with 5 column in
subreport and in some condition i need to remove specific colum and in other condition add specific column plz provide way
 Feb 07 2020 10:00 AM
Posted by a ceTe Software moderator
Hello,

The PDF creation is completely dependent on the DLEX file (layout template). You can suppress the layout of specific data by setting the Layout property to false in LayingOut event of the Layout element (RecordBox or RecordArea). It is not possible to add a new column or layout element dynamically to the DLEX file.

Thanks,
ceTe Software Support Team

 Feb 11 2020 3:35 AM
Thanks ,
I found alternat way but again i stuck in case.
Should i pass page.element or page in supreport?

I draw table in page
And now i want to pass that page in subreport
Or table in subreport.
 Feb 11 2020 3:36 AM
Thanks ,
I found alternat way but again i stuck in case.
Should i pass page.element or page in supreport?

I draw table in page
And now i want to pass that page in subreport
Or table in subreport.
 Feb 11 2020 12:15 PM
Posted by a ceTe Software moderator
Hello,

You can add a page element (Table, Image, TextArea, etc) to the PDF report dynamically using a PlaceHolder layout element. You will need to place a PlaceHolder in a sub report. Use the LaidOut event of the Placeholder layout element to add a page element. You can refer to the documentation on handling events here. The code sample in the help topic is for adding a barcode to the PDF using the LaidOut event. Similarly you can add a Table page element.

Thanks,
ceTe Software Support Team
 Feb 12 2020 12:25 AM
Thanks i already did it.
But i stuck in one case that files i send you in mail @ support ok
I already buy license so u can got mail from piyush.prajapati@cygnetinfotech.com
So please provide me solution for one of the problem. I will attach both my .net file and pdf
Thanks
Piyush prajapati
 Feb 13 2020 9:21 AM
Please provide me an example of create table in recoard box using any among datatable, table
 Feb 19 2020 11:29 AM
Posted by a ceTe Software moderator
Hello,

You can create a PDF report, using a DataTable. You will need to add the DataTableReportData to the NameValueLayoutData. The DataTableReportData should be added with the DataTable retrieved from the Database. Below is a code sample to create a PDF report using version 10 of DynamicPDF ReportWriter.

Please note that, you will need to set the DataName for the Details section (DLEX file) accordingly with the Key name specified in the Add method of NameValueLayoutData.


        static void Main(string[] args)
        {
            DocumentLayout report = new DocumentLayout(@"Mydocument.dlex");
            NameValueLayoutData layoutData = new NameValueLayoutData();
            layoutData.Add("Invoice", RetriveSqlOrderReportData());
            Document document = report.Layout(layoutData);
            document.Draw("MyDocument.pdf");
        }

        private static DataTableReportData RetriveSqlOrderReportData()
        {
            SqlConnection con = new SqlConnection(@"Add a valid connection string");
            con.Open();
            SqlCommand cmd = new SqlCommand("Sql query to retrieve the data", con);
            SqlDataReader reader = cmd.ExecuteReader();
            DataTable table = new DataTable("Invoice");
            table.Load(reader);
            return new DataTableReportData(table);
        }

Thanks,
ceTe Software Support Team
 Mar 16 2020 9:30 AM
Hi i use formetted record area in which i pass string with <b></b> but it is not bold my text
 Mar 16 2020 12:10 PM
Posted by a ceTe Software moderator
Hello,
 
We tested this on our end using v10 of DynamicPDF ReportWriter and are unable to recreate the behavior. The text specified with a bold tag is added to the PDF as bold text.
 
If you are setting a custom font then make sure to add the font family using the respective regular, bold, bold italics and italics fonts (OTF or TTF). Set this font family to the element using font face property.
 
To do this, select the  FormattedRecordArea element in DLEX file, click on the Font face property>>Edit>>Add a font family>>Set the respective OTF or TTF fonts for the styles.
 
Thanks,
ceTe software Support Team

All times are US Eastern Standard time. The time now is 4:19 PM.