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
40
UltraGridDocumentExporter
posted

When using the UltraGridDocumentExporter it seems to place the UltraWebGrid that I'm exporting always on the bottom of the section that it is being exported to.

 Is there a way to change this?  (ie place text on the top and bottom of the grid that is to be exported instead of just the top?) I tried creating multiple sections, but then I get multiple pages with the top part of the report on the first page, the grid on the second/third page and the final text on a fourth page.

 If I try entering the top text, grid and bottom text into the same section all my text seems to end up on the top of the report and none under the grid.

I can't locate any examples of source code, I tried looking for samples in the infragistics directory, but don't seem to have any.

Any help would be greatly appreciated.

 

  • 230
    Verified Answer
    posted

    HI

     Sorry for the delay.

    You vcan use  

    protected void uwgdeExport_EndExport(object sender, EndExportEventArgs e)

    {

    IText text = e.Section.AddText();

    Infragistics.Documents.Report.Text.Style contentStyle = new Infragistics.Documents.Report.Text.Style(new Font("Vardanada", 10), Brushes.Black);

     

    text.AddContent("Content to be displayed after the grid", contentStyle);

     

    }

    To display your footer text.

    And

    protected void uwgdeExport_HeaderRowExporting(object sender, MarginRowExportingEventArgs e)

    {

    ITableRow row = e.ContainingTable.AddRow();

    ITableCell cell = row.AddCell();

    IText cellText = cell.AddText();

    for (int i = 0; i < uwgHeader.Rows.Count; i++)

    {

    row = e.ContainingTable.AddRow();

    for (int j = 0; j < uwgHeader.Columns.Count; j++)

    {

    cell = row.AddCell();

    cell.Paddings.Top = 2;

    cell.Paddings.Bottom = 2;

    cellText = cell.AddText();

    if (uwgHeader.RowsIdea.Cells[j].Value.ToString().StartsWith("<img src='Images/Header/Logo.jpg'"))

    {

    //cell.Width = new RelativeWidth(350);

    //Infragistics.Documents.Report.ICanvas canvas = cell.AddCanvas();

    Infragistics.Documents.Graphics.Image img = new Infragistics.Documents.Graphics.Image(Server.MapPath("./Images/Header/Logo.jpg"));

    //Specify the FLATE compressor to get the best quality but it still compresses the image.

    img.Preferences.Converter = Infragistics.Documents.Graphics.ImageConverters.RGB;

    img.Preferences.Compressor = Infragistics.Documents.Graphics.ImageCompressors.JPEG;

    //canvas.DrawImage(img, 0, 0, 77, 293);

    cellText.AddContent(img);

    }

    else

    cellText.AddContent("Your Conytenct");if (i == uwgHeader.Columns.Count - 1)

    cellText.AddLineBreak();

    }

    }

    }

    use to display your heder content.

     Yup if you have any further qyery then let me know.

     Regards,

    Dhaval