RTC Report Export Error

yukonyukon Member Posts: 361
edited 2012-09-01 in NAV Three Tier
Dear Team,


We are trying to save as pdf/excel format from our customize report. Those customize report is shown item information with picture. We can be preview the report but can't save as.

Error is
non-negative number required
parameter name :value

Server Info

Intel(R) Xeon(R) CPU E5620@2.40GH
RAM : 16GB
System Type : 64Bit
Page File Size :16373MB

But i can be export out at my pc. #-o

Regards,
Yukon
Make Simple & Easy

Comments

  • clauslclausl Member Posts: 455
    I think this might be related to a images in you database which have a lot of meta data. Report Viewer 2008 is sensitive to these images, unfortunately #-o This is fixed in Report Viewer 2010, which is supported in NAV 2013.
    Try to run the report without Pictures. If the report runs fine, then try to run the report with a few images.
    If it fails again delete all the meta data on these few images and run report again.
    If it runs fine include more Pictures until it fails and then delete all the meta data on the just included images. You repeat this until your report runs with all images. I think there might be tools which can remove metadata on images in a batch.
    But then again this might not be issue, but give it a try.

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • yukonyukon Member Posts: 361
    Dear clausl,

    Thanks for your reply. Before i post at here i tried to print and save as excel/pdf without picture. It's ok. If i save as again with picture it only can view cannot save as. ](*,)
    I think this might be related to a images in you database which have a lot of meta data
    I think there might be tools which can remove metadata on images in a batch.
    Is it inside database or where? How can i clear the meta data?

    I didn't clear meta data and i never tried one by one.
    I think this way but not sure is it correct way or not. What i think is "run-time load the picture during run the report (Picture save at one folder)". If i do that way how about the performance. [-(



    Regards,
    Yukon
    Make Simple & Easy
  • clauslclausl Member Posts: 455
    1. Export one of the images which gives error to desktop.
    2. Right click image
    3. Select "Properties"
    4. Select "Details" tab
    5. Hit "Remove Properties and Personal Information"
    6. Import Picture back into NAV. Tip, if you import from RTC you can import in JPG format and not BMP as you have to in Classic.
    7. Run report with only this image. Hopefully it Works now.

    Concerning performance it's better to embed the image into the report. This way it is not repeated in dataset for each row and your report performs much better, so if this possible I recommend that you do this. But of course you loose the flexibilty of changing the images in NAV. You need to decide what is best solution for you.

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • yukonyukon Member Posts: 361
    Dear clausl,

    Thanks again to you.
    6. Import Picture back into NAV. Tip, if you import from RTC you can import in JPG format and not BMP as you have to in Classic.
    7. Run report with only this image. Hopefully it Works now.
    They are using the RTC only and most pictures are "jpg" format. Is it any issue of file type on this case.
    so if this possible I recommend that you do this. But of course you loose the flexibilty of changing the images in NAV.
    I also though this case. Here is idea for changing image.
    1. All images will be save in nav.
    2. Export the image to defined folder when the report is running.
    3. Show the picture on report base on related information.

    Do you have any comment on my idea? All are idea i haven't test it :roll:

    Regards,
    Yukon
    Make Simple & Easy
  • clauslclausl Member Posts: 455
    Use the External images and link to it from your report. You need set EnableExternalImages in the report. Then you need to figure out how to place the image in the folder the report can access at run time. And of course you need to test if this works for other users as well.

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • yukonyukon Member Posts: 361
    Dear Claus,

    You're right!
    You need set EnableExternalImages in the report.

    Start facing problem with this one. ](*,)
    I read this "EnableExternalImages Property" http://msdn.microsoft.com/en-us/library/ff477109
    With an external image, the source file is stored outside of the report in a location that must be accessible from the RoleTailored client, such as on a file server or local computer. The image is referenced from the report and loads when the report opens. To use external images on a report, the EnableExternalImages property must be set to Yes.
    Microsoft Dynamics NAV 2009 cannot verify image sources and protect against malicious images or sources that may be harmful to your computer. You should set the EnableExternalImages property to Yes only if you can ensure that images on the report come from a trusted source.

    It does not point how to set it. Can you point to me how to set it? I know that at ".net" application how to set it. :?

    Regards,
    Yukon
    Make Simple & Easy
  • clauslclausl Member Posts: 455
    It's a property on the report in NAV :)

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • yukonyukon Member Posts: 361
    clausl wrote:
    It's a property on the report in NAV :)

    /Claus Lundstrøm
    :mrgreen:

    If i can do well i'll post here again.

    Thanks for your help and information.

    Let me test it .....

    Regards,
    Yukon
    Make Simple & Easy
  • yukonyukon Member Posts: 361
    Dear Claus,
    Claus wrote:
    I think this might be related to a images in you database which have a lot of meta data.
    That's right! I shown one picture on my report and save as to pdf. I got the error. And then i replace with other picture (1MB - Size). At that time i can save as. So i use software http://digitalconfidence.com/downloads.html and remove the meta data from image and load back to database. This time is work.
    yukon wrote:
    I think this way but not sure is it correct way or not. What i think is "run-time load the picture during run the report (Picture save at one folder)". If i do that way how about the performance. [-(
    After i tested, i thought it not so much different between External and Data Source. Because of if we use External method all pictures saved/download to client side during report running. How do you think on this?

    Here is Item Picture Load External Path Code for Share
    OBJECT Report 90000 Item Picture
    {
      OBJECT-PROPERTIES
      {
        Date=12-09-02;
        Time=21:29:34;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        EnableExternalImages=Yes;
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table27;
            DataItemTableView=SORTING(No.);
            OnAfterGetRecord=BEGIN
                               IF NOT Picture.HASVALUE THEN
                                 CurrReport.SKIP;
                               g_txtReportPath := fnExportImage(Item);
                             END;
    
            ReqFilterFields=No.;
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=18000;
                SectionHeight=2961;
              }
              CONTROLS
              {
                { 1000000008;TextBox;1800 ;0    ;5850 ;423  ;HorzAlign=Left;
                                                             SourceExpr="No.";
                                                             DataSetFieldName=Item__No__ }
                { 1000000011;TextBox;1800 ;423  ;5850 ;423  ;HorzAlign=Left;
                                                             SourceExpr=Description;
                                                             DataSetFieldName=Item_Description }
                { 1000000012;Label  ;0    ;423  ;1800 ;423  ;ParentControl=1000000011;
                                                             FontBold=Yes;
                                                             DataSetFieldName=Item_DescriptionCaption }
                { 1000000000;PictureBox;8100;0  ;6300 ;2538 ;SourceExpr=Item.Picture;
                                                             DataSetFieldName=Item_Item_Picture }
                { 1000000007;TextBox;14550;0    ;3450 ;423  ;Visible=No;
                                                             ForeColor=65535;
                                                             SourceExpr=g_txtReportPath;
                                                             DataSetFieldName=g_txtReportPath }
                { 1000000009;Label  ;0    ;0    ;1800 ;423  ;ParentControl=1000000008;
                                                             FontBold=Yes;
                                                             DataSetFieldName=Item__No__Caption }
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=9020;
          Height=3410;
        }
        CONTROLS
        {
        }
      }
      REQUESTPAGE
      {
        PROPERTIES
        {
        }
        CONTROLS
        {
        }
      }
      CODE
      {
        VAR
          g_txtReportPath@1000000000 : Text[1024];
          Text50000@1000000002 : TextConst 'ENU=Picture_%1.jpg';
          Text50001@1000000001 : TextConst 'ENU=File://%1';
    
        LOCAL PROCEDURE fnExportImage@1000000000(recItem@1000000000 : Record 27) : Text[1024];
        VAR
          recBlobRef@1000000005 : Record 99008535;
          cu3TierAutomationMgt@1000000004 : Codeunit 419;
          txtFilName@1000000003 : Text[1024];
          txtTmpFilName@1000000006 : Text[1024];
          txtFldPath@1000000002 : Text[1024];
          txtReportPath@1000000001 : Text[1024];
        BEGIN
          IF NOT ISSERVICETIER THEN EXIT;
          IF recItem.Picture.HASVALUE THEN BEGIN
            recBlobRef.Blob := recItem.Picture;
            txtFilName := STRSUBSTNO(Text50000,recItem."No."); //I set picture file name but it will be auto generate durning BLBExport
            txtTmpFilName := cu3TierAutomationMgt.BLOBExport(recBlobRef,txtFilName,FALSE); //It'll be save in Client.
            txtReportPath := STRSUBSTNO(Text50001,txtTmpFilName);
          END;
          EXIT(txtReportPath);
        END;
    
        BEGIN
        {
          ID    Date      Author  Description
          ====================================================================================================================================
                02-09-12  yukonn  Load item picture during report running. (For RTC)
        }
        END.
      }
      RDLDATA
      {
        <?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
      <Author>yukonn</Author>
      <Body>
        <Height>3.05714cm</Height>
        <ReportItems>
          <Table Name="Table1">
            <DataSetName>DataSet_Result</DataSetName>
            <Details>
              <TableRows>
                <TableRow>
                  <Height>0.63492cm</Height>
                  <TableCells>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="Item__No__Caption">
                          <Style>
                            <FontSize>7pt</FontSize>
                            <FontWeight>700</FontWeight>
                            <PaddingBottom>2pt</PaddingBottom>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>0.075cm</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <TextAlign>Left</TextAlign>
                            <VerticalAlign>Middle</VerticalAlign>
                          </Style>
                          <Value>=Fields!Item__No__Caption.Value</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="Item__No__">
                          <Style>
                            <FontSize>7pt</FontSize>
                            <PaddingBottom>2pt</PaddingBottom>
                            <PaddingLeft>0.075cm</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <TextAlign>Left</TextAlign>
                            <VerticalAlign>Middle</VerticalAlign>
                          </Style>
                          <Value>=Fields!Item__No__.Value</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="textbox7">
                          <CanGrow>true</CanGrow>
                          <Style>
                            <TextAlign>Center</TextAlign>
                          </Style>
                          <Value />
                          <rd:DefaultName>textbox7</rd:DefaultName>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                  </TableCells>
                </TableRow>
                <TableRow>
                  <Height>2.22222cm</Height>
                  <TableCells>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="Item_DescriptionCaption">
                          <Style>
                            <FontSize>7pt</FontSize>
                            <FontWeight>700</FontWeight>
                            <PaddingBottom>2pt</PaddingBottom>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>0.075cm</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <TextAlign>Left</TextAlign>
                            <VerticalAlign>Middle</VerticalAlign>
                          </Style>
                          <Value>=Fields!Item_DescriptionCaption.Value</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="Item_Description">
                          <Style>
                            <FontSize>7pt</FontSize>
                            <PaddingBottom>2pt</PaddingBottom>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <TextAlign>Left</TextAlign>
                            <VerticalAlign>Middle</VerticalAlign>
                          </Style>
                          <Value>=Fields!Item_Description.Value</Value>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Image Name="image1">
                          <Sizing>Fit</Sizing>
                          <Source>External</Source>
                          <Style />
                          <Value>=Fields!g_txtReportPath.Value</Value>
                        </Image>
                      </ReportItems>
                    </TableCell>
                  </TableCells>
                </TableRow>
                <TableRow>
                  <Height>0.2cm</Height>
                  <TableCells>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="textbox1">
                          <CanGrow>true</CanGrow>
                          <Style>
                            <FontSize>7pt</FontSize>
                            <PaddingBottom>2pt</PaddingBottom>
                            <PaddingLeft>0.075cm</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <TextAlign>Left</TextAlign>
                            <VerticalAlign>Middle</VerticalAlign>
                          </Style>
                          <Value />
                          <rd:DefaultName>textbox1</rd:DefaultName>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="textbox2">
                          <CanGrow>true</CanGrow>
                          <Style>
                            <FontSize>7pt</FontSize>
                            <PaddingBottom>2pt</PaddingBottom>
                            <PaddingLeft>2pt</PaddingLeft>
                            <PaddingRight>2pt</PaddingRight>
                            <PaddingTop>2pt</PaddingTop>
                            <TextAlign>Left</TextAlign>
                            <VerticalAlign>Middle</VerticalAlign>
                          </Style>
                          <Value />
                          <rd:DefaultName>textbox2</rd:DefaultName>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                    <TableCell>
                      <ReportItems>
                        <Textbox Name="textbox3">
                          <CanGrow>true</CanGrow>
                          <Value />
                          <rd:DefaultName>textbox3</rd:DefaultName>
                        </Textbox>
                      </ReportItems>
                    </TableCell>
                  </TableCells>
                </TableRow>
              </TableRows>
            </Details>
            <TableColumns>
              <TableColumn>
                <Width>3.65071cm</Width>
              </TableColumn>
              <TableColumn>
                <Width>8.88889cm</Width>
              </TableColumn>
              <TableColumn>
                <Width>7.30143cm</Width>
              </TableColumn>
            </TableColumns>
            <Width>7.81241in</Width>
          </Table>
        </ReportItems>
      </Body>
      <BottomMargin>0in</BottomMargin>
      <Code>Public Function BlankZero(ByVal Value As Decimal)
        if Value = 0 then
            Return ""
        end if
        Return Value
    End Function
    
    Public Function BlankPos(ByVal Value As Decimal)
        if Value > 0 then
            Return ""
        end if
        Return Value
    End Function
    
    Public Function BlankZeroAndPos(ByVal Value As Decimal)
        if Value >= 0 then
            Return ""
        end if
        Return Value
    End Function
    
    Public Function BlankNeg(ByVal Value As Decimal)
        if Value < 0 then
            Return ""
        end if
        Return Value
    End Function
    
    Public Function BlankNegAndZero(ByVal Value As Decimal)
        if Value <= 0 then
            Return ""
        end if
        Return Value
    End Function
    </Code>
      <DataSets>
        <DataSet Name="DataSet_Result">
          <Fields>
            <Field Name="Item__No__">
              <DataField>Item__No__</DataField>
            </Field>
            <Field Name="Item_Description">
              <DataField>Item_Description</DataField>
            </Field>
            <Field Name="Item_DescriptionCaption">
              <DataField>Item_DescriptionCaption</DataField>
            </Field>
            <Field Name="Item_Item_Picture">
              <DataField>Item_Item_Picture</DataField>
            </Field>
            <Field Name="g_txtReportPath">
              <DataField>g_txtReportPath</DataField>
            </Field>
            <Field Name="Item__No__Caption">
              <DataField>Item__No__Caption</DataField>
            </Field>
          </Fields>
          <Query>
            <CommandText />
            <DataSourceName>DummyDataSource</DataSourceName>
          </Query>
          <rd:DataSetInfo>
            <rd:DataSetName>DataSet</rd:DataSetName>
            <rd:TableName>Result</rd:TableName>
          </rd:DataSetInfo>
        </DataSet>
      </DataSets>
      <DataSources>
        <DataSource Name="DummyDataSource">
          <ConnectionProperties>
            <ConnectString />
            <DataProvider>SQL</DataProvider>
          </ConnectionProperties>
          <rd:DataSourceID>41b6025e-f023-400b-82ed-7964dd70ebf4</rd:DataSourceID>
        </DataSource>
      </DataSources>
      <InteractiveHeight>29.7cm</InteractiveHeight>
      <InteractiveWidth>18.7cm</InteractiveWidth>
      <Language>=User!Language</Language>
      <LeftMargin>0.25in</LeftMargin>
      <PageHeight>11.7in</PageHeight>
      <PageWidth>8.3in</PageWidth>
      <RightMargin>0in</RightMargin>
      <TopMargin>0.25in</TopMargin>
      <Width>7.875in</Width>
      <rd:DrawGrid>true</rd:DrawGrid>
      <rd:ReportID>b147e376-dfd8-4bad-b58b-e2a08e60df8f</rd:ReportID>
      <rd:SnapToGrid>true</rd:SnapToGrid>
    </Report>
        END_OF_RDLDatA
      }
    }
    

    Thanks for your help.

    Best Regards,
    Yukon
    Make Simple & Easy
Sign In or Register to comment.