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
255
genarating pdf file
posted

can anyone help me in generating pdf from  infragistics.document

Parents
  • 469350
    Offline posted

     Hi,

          Can you be a little more specific? What's the problem? What are you trying to do?

Reply Children
  • 255
    posted in reply to Mike Saltzman

    using infragistics.document.PDF;

     

    I have try to create pdfdocument with help of output stream, but i am getting emptypdf document only.

    Actually i need to convert one aspx page ouput to pdf document.

    (What you see what you get )

     

    pdfDocument pdfDoc = new pdfDocument();

     Response.AddHeader("Content-Type", "application/pdf");
     Response.AddHeader("Content-Disposition", "inline;filename=HelloWorld.pdf");
     pdfDoc .generate(Response.OutputStream, FileFormat.PDF);
     

    I would like to convert the below html page into pdf format .... 

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="warpdemo.aspx.cs" Inherits="webgrid" %>

    <%@ Register Assembly="Infragistics2.WebUI.WebCombo.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.WebUI.WebCombo" TagPrefix="igcmbo" %>
    <%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>
    <%@ Register Assembly="Infragistics2.WebUI.Misc.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.WebUI.Misc" TagPrefix="igmisc" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="Form1" method="post" runat="server">
            &nbsp;<table>
                <tr>
                   
                    <td valign="top" style="padding-top: 17px;">
                        <table>
                            <tr>
                                <td class="Label">
                                    Select Customer ID:
                                </td>
                                <td style="padding-top: 7px;">
                                    &nbsp;</td>
                            </tr>
                        </table>
                          <igcmbo:WebCombo ID="WebCombo1" runat="server" BackColor="White" BorderColor="Silver"
                BorderStyle="Solid" BorderWidth="1px" DataSourceID="SqlDataSource2" ForeColor="Black"
                SelBackColor="DarkBlue" SelForeColor="White" Version="4.00" OnSelectedRowChanged="WebCombo1_SelectedRowChanged">
                <Columns>
                    <igtbl:UltraGridColumn BaseColumnName="customerId" DataType="System.Int32" IsBound="True"
                        Key="customerId">
                        <header caption="customerId"></header>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="companyName" IsBound="True" Key="companyName">
                        <header caption="companyName">
    <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
    </header>
                        <footer>
    <RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
    </footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="contactName" IsBound="True" Key="contactName">
                        <header caption="contactName">
    <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
    </header>
                        <footer>
    <RowLayoutColumnInfo OriginX="2"></RowLayoutColumnInfo>
    </footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="address" IsBound="True" Key="address">
                        <header caption="address">
    <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
    </header>
                        <footer>
    <RowLayoutColumnInfo OriginX="3"></RowLayoutColumnInfo>
    </footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="Projectdescription" IsBound="True" Key="Projectdescription">
                        <header caption="Projectdescription">
    <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
    </header>
                        <footer>
    <RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
    </footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="Project" IsBound="True" Key="Project">
                        <header caption="Project">
    <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
    </header>
                        <footer>
    <RowLayoutColumnInfo OriginX="5"></RowLayoutColumnInfo>
    </footer>
                    </igtbl:UltraGridColumn>
                    <igtbl:UltraGridColumn BaseColumnName="Officename" IsBound="True" Key="Officename">
                        <header caption="Officename">
    <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo>
    </header>
                        <footer>
    <RowLayoutColumnInfo OriginX="6"></RowLayoutColumnInfo>
    </footer>
                    </igtbl:UltraGridColumn>
                </Columns>
                <ExpandEffects ShadowColor="LightGray" />
                <DropDownLayout BaseTableName="" BorderCollapse="Separate" RowHeightDefault="20px"
                    Version="4.00" XmlLoadOnDemandType="Synchronous">
                    <FrameStyle BackColor="Silver" BorderStyle="Ridge" BorderWidth="2px" Cursor="Default"
                        Font-Names="Verdana" Font-Size="10pt" Height="130px" Width="325px">
                    </FrameStyle>
                    <HeaderStyle BackColor="LightGray" BorderStyle="Solid">
                        <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                    </HeaderStyle>
                    <RowStyle BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px">
                        <BorderDetails WidthLeft="0px" WidthTop="0px" />
                    </RowStyle>
                    <SelectedRowStyle BackColor="DarkBlue" ForeColor="White" />
                </DropDownLayout>
            </igcmbo:WebCombo>
                        </td>
                        <td>
                          <table>
                          <tr><td>
                              &nbsp;</td></tr>
                          </table>                   
                    </td>
                </tr>
                <tr>
                   
                    <td valign="top" >
                        <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Width="550px" Height="100px"
                             BorderStyle="Solid" BorderWidth="1px" TriggerControlIDs="WebCombo1"
                            LinkedRefreshControlID="WebAsyncRefreshPanel2" BorderColor="#E0E0E0">
                            <table style="width: 464px; height: 96px">
                                <tr>
                                    <td class="Label">
                                      Comapny Name:
                                    </td>
                                    <td class="ValueLabel">
                                        <asp:Label ID="lblCompanyName" runat="server" />
                                    </td>
                                    <td class="Label">
                                       Contact Name
                                    </td>
                                    <td class="ValueLabel">
                                        <asp:Label ID="lblName" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="Label">
                                        Project
                                    </td>
                                    <td class="ValueLabel">
                                        <asp:Label ID="lblProject" runat="server" />
                                    </td>
                                  
                                   
                                </tr>
                                <tr>
                                    <td class="Label" style="height: 32px">
                                        Project Description
                                    </td>
                                    <td class="ValueLabel" style="height: 32px">
                                        <asp:Label ID="lblDescription" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="Label" style="height: 32px">
                                        Office Name
                                    </td>
                                    <td class="ValueLabel" style="height: 32px">
                                        <asp:Label ID="lbloffice" runat="server" />
                                    </td>
                                </tr>
                               
                            </table>
                        </igmisc:WebAsyncRefreshPanel>
                    </td>
                </tr>
                <tr>
                   
                    <td valign="top" style="padding-top: 23px;">
                        <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel2" runat="server" Width="501px"
                            Height="183px" BorderStyle="Solid" BorderWidth="1px" RefreshTargetIDs="lblTotal"
                            BorderColor="#E0E0E0">
                            <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"
                                DataMember="Orders" ImageDirectory="../../styles/office2007black/WebGrid/">
                                <DisplayLayout AllowDeleteDefault="Yes" StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True"
                                    AllowSortingDefault="OnClient" RowHeightDefault="20px" Version="4.00" ViewType="OutlookGroupBy"
                                    SelectTypeRowDefault="Extended" AllowColumnMovingDefault="OnServer" HeaderClickActionDefault="SortMulti"
                                    BorderCollapseDefault="Separate" AllowColSizingDefault="Free" RowSelectorsDefault="No"
                                    Name="UltraWebGrid1" TableLayout="Fixed" AllowUpdateDefault="Yes" CellClickActionDefault="RowSelect"
                                    CompactRendering="False" GridLinesDefault="NotSet">
                                    <AddNewBox Hidden="False">
                                        <ButtonStyle CssClass="igwgAddNewBtnBlack2k7">
                                        </ButtonStyle>
                                        <BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px">
                                            <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                                        </BoxStyle>
                                    </AddNewBox>
                                    <Pager>
                                        <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                                            <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                                        </PagerStyle>
                                    </Pager>
                                    <HeaderStyleDefault CssClass="igwgHdrBlack2k7">
                                        <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
                                    </HeaderStyleDefault>
                                    <GroupByRowStyleDefault CssClass="igwgGrpRowBlack2k7">
                                    </GroupByRowStyleDefault>
                                    <FrameStyle CssClass="igwgFrameBlack2k7">
                                    </FrameStyle>
                                    <FilterOptionsDefault DropDownRowCount="15">
                                        <FilterHighlightRowStyle CssClass="igwgFltrRowHiLtBlack2k7">
                                        </FilterHighlightRowStyle>
                                        <FilterDropDownStyle CssClass="igwgFltrDrpDwnBlack2k7">
                                        </FilterDropDownStyle>
                                    </FilterOptionsDefault>
                                    <FooterStyleDefault CssClass="igwgFooterBlack2k7">
                                        <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
                                    </FooterStyleDefault>
                                    <GroupByBox>
                                        <BandLabelStyle CssClass="igwgGrpBoxBandLblBlack2k7">
                                        </BandLabelStyle>
                                        <BoxStyle BackColor="ActiveBorder" BorderColor="Window">
                                        </BoxStyle>
                                    </GroupByBox>
                                    <Images ImageDirectory="../../styles/office2007black/WebGrid/" />
                                    <EditCellStyleDefault CssClass="igwgCellEdtBlack2k7">
                                    </EditCellStyleDefault>
                                    <RowStyleDefault CssClass="igwgRowBlack2k7">
                                        <Padding Left="3px"></Padding>
                                        <BorderDetails ColorTop="Window" ColorLeft="Window"></BorderDetails>
                                    </RowStyleDefault>
                                    <ActivationObject BorderColor="181, 196, 223" BorderWidth="">
                                        <BorderDetails WidthLeft="0px" WidthRight="0px" />
                                    </ActivationObject>
                                    <RowExpAreaStyleDefault CssClass="igwgRowExpBlack2k7">
                                    </RowExpAreaStyleDefault>
                                    <SelectedGroupByRowStyleDefault CssClass="igwgGrpRowSelBlack2k7">
                                    </SelectedGroupByRowStyleDefault>
                                    <RowSelectorStyleDefault CssClass="igwgRowSlctrBlack2k7">
                                    </RowSelectorStyleDefault>
                                    <FixedHeaderStyleDefault CssClass="igwgHdrFxdBlack2k7">
                                    </FixedHeaderStyleDefault>
                                    <SelectedRowStyleDefault CssClass="igwgRowSelBlack2k7">
                                    </SelectedRowStyleDefault>
                                    <RowAlternateStyleDefault CssClass="igwgRowAltBlack2k7">
                                    </RowAlternateStyleDefault>
                                    <SelectedHeaderStyleDefault CssClass="igwgHdrSelBlack2k7">
                                    </SelectedHeaderStyleDefault>
                                    <FormulaErrorStyleDefault CssClass="igwgFormulaErrBlack2k7">
                                    </FormulaErrorStyleDefault>
                                    <FixedCellStyleDefault CssClass="igwgCellFxdBlack2k7">
                                    </FixedCellStyleDefault>
                                    <FixedFooterStyleDefault CssClass="igwgFtrFxdBlack2k7">
                                    </FixedFooterStyleDefault>
                                </DisplayLayout>
                                <Bands>
                                    <igtbl:UltraGridBand>
                                        <AddNewRow View="NotSet" Visible="NotSet">
                                        </AddNewRow>
                                    </igtbl:UltraGridBand>
                                </Bands>
                               
                            </igtbl:UltraWebGrid>
                        </igmisc:WebAsyncRefreshPanel>
                    </td>
                </tr>
                <tr>
                   
                    <td valign="top" style="padding-top: 18px;">
                        TOTAL:
                        <asp:Label ID="lblTotal" Width="50px" runat="server" BorderWidth="1px" BorderStyle="Solid" /></td>
                </tr>
            </table>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ProductManagementConnectionString8 %>"
                SelectCommand="SELECT [customerId] FROM [Customer_Details]"></asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ProductManagementConnectionString9 %>"
                SelectCommand="SELECT [customerId], [companyName], [contactName], [address], [Projectdescription], [Project], [Officename] FROM [Customer_Details]">
            </asp:SqlDataSource>
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Generate Report" />
           
           
        </form>
    </body>

    </html>

     

    Thanks in Advance .