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
209
UltraWebGridDocumentExporter.Export
posted

Hi there,

In my project I want to export a grid, and in documentation this looks like very simple task, but it doesn't work in my case and the error doesn't mean anything.

 // This is my DocumentExporter and my Grid

<igtbldocexp:UltraWebGridDocumentExporter ID="UltraWebGridDocumentExporter1" runat="server" DataExportMode="DataInGridOnly" TargetPaperSize="A4" />

<
igtbl:UltraWebGrid ID="GridDocumentLibrary" SkinID="uwgStandart" runat="server" Width="100%" OnPreRender="GridDocumentLibrary_OnPreRender">
<Bands>
   <igtbl:UltraGridBand>
      <Columns>
        <igtbl:TemplatedColumn BaseColumnName="CheckB" Key="CheckB" Type="CheckBox" DataType="System.Boolean" AllowUpdate="Yes" Width="5%">
            <HeaderTemplate>
                <input id="chboxDocLibraryHeaderCheck" type="checkbox" onclick="COMMON_checkHeader_OnClick_CheckB('<%= GridDocumentLibrary.ClientID %>',this)"  />
            </HeaderTemplate>
        </igtbl:TemplatedColumn>
       
<igtbl:UltraGridColumn AllowUpdate="No" BaseColumnName=
"Regarding" GatherFilterData="False" Key="Regarding" Width="30%">
            <
Header Caption="HeaderRegarding" />
       
</igtbl:UltraGridColumn>
        <igtbl:UltraGridColumn AllowUpdate="No" BaseColumnName="FileName" GatherFilterData=
"False" HeaderClickAction="Select" Key="FileName" Width="28%">
            <Header Caption="HeaderFileName" />
        </igtbl:UltraGridColumn>
        <igtbl:UltraGridColumn AllowUpdate="No" BaseColumnName="FileUrl" GatherFilterData=
"False" HeaderClickAction="Select" Key="FileUrl" Hidden="True" />
        <igtbl:UltraGridColumn AllowUpdate="No" BaseColumnName="RegardingTypeKey" GatherFilterData=
"False" HeaderClickAction="Select" Key="RegardingTypeKey" Hidden="True" />   
       
<igtbl:UltraGridColumn AllowUpdate="No" BaseColumnName="EntityType" GatherFilterData=
"False" HeaderClickAction="Select" Key="EntityType" Hidden="True" />                     
        <igtbl:TemplatedColumn Key="Chat" Width="5%" BaseColumnName="Chat" HeaderClickAction="Select" >
            <CellTemplate>
                <asp:Image ID="imgChat" runat="server" ImageUrl="~/Image/ico_16_9.gif" Visible='<%# Utils.CheckOnlineUsers(Utils.StringToGuid(Container.Cell.Text)) %>' />&nbsp;
            </CellTemplate>
        </igtbl:TemplatedColumn>
      </
Columns>
    </igtbl:UltraGridBand>
  </Bands>
</igtbl:UltraWebGrid>

// This is my C# code, that I found in the help

UltraWebGridDocumentExporter1.ExportMode = Infragistics.WebUI.UltraWebGrid.Exporter.ExportMode.Custom;
UltraWebGridDocumentExporter1.Format = Infragistics.Documents.Report.FileFormat.PlainText;
string s = @"d:\WebGrid2.txt";
FileStream fileStream = File.OpenWrite(s);
UltraWebGridDocumentExporter1.Export(GridDocumentLibrary, fileStream, true);

 

 

I don't know where is the problem, is it my TemplatedColumns (I check that, they won't be exported according the documentation, and that will be OK with me, if the exportation works).

I need to export at excell, pdf and plain text. Can anybody help me? Yes

 

Regards, Iva

 

Parents Reply Children