Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Simple grid with title
posted

How would I export a PDF with a title and the contents of a grid? The documentation seems practically non-existant. In my code behind I have:

 protected void ExportClassListButton_Click(object sender, Infragistics.WebUI.WebDataInput.ButtonEventArgs e)

{

 

 

 

 

var report = new Report();

 

 

ISection section = report.AddSection();

 

 

 

var header = section.AddText();

header.AddContent( "My Title" )

 

;

header.Alignment =

 

new TextAlignment(Alignment.Center);

 

 

 

 

 

 

 

var body = report.AddSection();

WebDocumentExporter.Export( MyGrid, report, body );

 }

 

However I end up with a page break between the title and the grid.

Parents
No Data
Reply
  • 29417
    Suggested Answer
    Offline posted

    Hello dharrington ,

     

    Thank you for posting in our forum.

     

    It seems that different sections represent different pages so you should add the grid and the title to the same section. If you need to set some space between them you can add a gap object. For example your code could look like this:

     

    protected void Button1_Click(object sender, EventArgs e)

        {

            var report = new Report();

            ISection section = report.AddSection();

            var header = section.AddText();

            header.AddContent("My Title");

            header.Alignment = new TextAlignment(Alignment.Center);

            IGap gap = section.AddGap();

            gap.Height = new FixedHeight(100);

            this.WebDocumentExporter1.Export(this.WebDataGrid1, report, section);

     

        }

     

    Please refer to the attached sample and let me know if you have any questions or concerns.

     

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://www.infragistics.com/support

     

    WDE_Grid.zip
Children
No Data