Export pdf issue from webgrid

1 reply. Last post: October 7, 2015 4:21 AM by Yudi
Tags :

Hi,

I have found so many white space on top, bottom, left and right.

Because of that my text is breaking in 2-3 lines in many columns.

Could you please help me how to remove white space and make column text in one line.

I have attached issue.

Also, can I make change of font size and font family?

Regards

Rupesh Shakti

Answers

Yudi Member

OnExport server-side event of WebGrid will suits your requirement well. You can always change the ReportPath property and other report-specific property such as paper-type, orientation etc, in the ReportInfo object provided by the event argument in OnExport event.

Following snippet code shows how to set Margin and font.

protected void WebGrid1_Export(object sender, ISNet.WebUI.WebGrid.ExportEventArgs e)
{
    // set Font size and Font family
    e.ReportInfo.DynFonts = new DynARFonts(new Font("Tahoma", 15), null, null, null, null, null, null, null, null);
        
    // set Margin size
    e.ReportInfo.DynMargins = new Margins { Bottom = 0f, Left = 0f, Right = 0f, Top = 0f };
}

This should helps.

All Replies

Yudi Member

OnExport server-side event of WebGrid will suits your requirement well. You can always change the ReportPath property and other report-specific property such as paper-type, orientation etc, in the ReportInfo object provided by the event argument in OnExport event.

Following snippet code shows how to set Margin and font.

protected void WebGrid1_Export(object sender, ISNet.WebUI.WebGrid.ExportEventArgs e)
{
    // set Font size and Font family
    e.ReportInfo.DynFonts = new DynARFonts(new Font("Tahoma", 15), null, null, null, null, null, null, null, null);
        
    // set Margin size
    e.ReportInfo.DynMargins = new Margins { Bottom = 0f, Left = 0f, Right = 0f, Top = 0f };
}

This should helps.

All times are GMT -5. The time now is 3:22 AM.
Previous Next