Problem exporting radgrid(promiteus) to PDF

10 posts, 0 answers
  1. Mira Vaig
    Mira Vaig avatar
    5 posts
    Member since:
    Mar 2008

    Posted 04 Jun 2008 Link to this post

     

    On Main.aspx i have a grid with templateColumn

    that contains image populated with another page (ImageUrl="LoadPicture.aspx?Indx=2).

    My Main.aspx and LoadPicture.aspx – are in the same folder ("FolderName").

    When I try to export to pdf , I get error :

    System.Web.HttpException: '/ProgectName/FolderName/LoadPicture.aspx?Indx=2' is not a valid virtual path.
      at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
      at System.Web.HttpServerUtility.MapPath(String path)
      at Telerik.Web.Apoc.Image.ApocImageFactory.Make(String href)
      at Telerik.Web.Apoc.Fo.Flow.ExternalGraphic.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
      at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
      at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
      at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
      at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)

    Stack Trace:

    [SystemException: System.Web.HttpException: '/ProjectName/FolderName/LoadPicture.aspx?Indx=2' is not a valid virtual path.
       at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
       at System.Web.HttpServerUtility.MapPath(String path)
       at Telerik.Web.Apoc.Image.ApocImageFactory.Make(String href)
       at Telerik.Web.Apoc.Fo.Flow.ExternalGraphic.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
       at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)
       at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
       at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
       at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
       at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)]
       Telerik.Web.Apoc.ApocDriver.FireApocError(String message) +78
       Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader) +628
       Telerik.Web.Apoc.ApocDriver.Render(XmlReader inputReader, Stream outputStream) +364
       Telerik.Web.Apoc.ApocDriver.Render(TextReader inputReader, Stream outputStream) +41
       Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderForm(HtmlTextWriter nullWriter, Control form) +1235
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2113547
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
       System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
       Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderPage(HtmlTextWriter nullWriter, Control page) +117
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2113547
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.Page.Render(HtmlTextWriter writer) +26
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +667
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2113547
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.Page.Render(HtmlTextWriter writer) +26
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896

     

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Jun 2008 Link to this post

    Hi Mira,

    Here is help article which explains how to export a Grid with GridTemplateColumn.
    Exporting tips and tricks

    Thanks
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mira Vaig
    Mira Vaig avatar
    5 posts
    Member since:
    Mar 2008

    Posted 04 Jun 2008 Link to this post

    hi,
    sorry , i don't see in this article explanation  how to resolve my problem.
    i repeat :
    the problem is with virtual path of image in GridTemplateColunm.
    my GridTemplateColumn contains Image with ImageUrl="LoadPicture.aspx?Indx=2".

    the error message :
    System.Web.HttpException: '/ProjectName/FolderName/LoadPicture.aspx?Indx=2' is not a valid virtual path.

  5. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 09 Jun 2008 Link to this post

    Hi


    You can use only virtual path

    Here is an example:

                <rad:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
                    <MasterTableView> 
                        <Columns> 
                            <rad:GridTemplateColumn UniqueName="MyGridTemplateColumn"
                                <ItemTemplate> 
                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Image.gif" /> 
                                </ItemTemplate>                             
                            </rad:GridTemplateColumn> 
                        </Columns> 
                    </MasterTableView> 
                </rad:RadGrid> 

    Regards...
    <John:Peel />
  6. Mira Vaig
    Mira Vaig avatar
    5 posts
    Member since:
    Mar 2008

    Posted 10 Jun 2008 Link to this post

    Hi,
    I dont see how  solve the problem that occurs in export
    of RadGrid (Prometeus) to  PDF in case :
                     grid has GridTemplateColumn that contains Image  with     ImageUrl="LoadPicture.aspx?Indx=2".
    The problem occurs only when i have parameter.
    If  ImageUrl="LoadPicture.aspx" - export works.

    the error message :
    System.Web.HttpException: '/ProjectName/FolderName/LoadPicture.aspx?Indx=2' is not a valid virtual path

    Any Idea?
  7. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 11 Jun 2008 Link to this post

    hi

    You can save the image in temp file

    Hope this helps...
    <John:Peel />
  8. Mira Vaig
    Mira Vaig avatar
    5 posts
    Member since:
    Mar 2008

    Posted 15 Oct 2008 Link to this post

    hi,
    i am back to my problem (export rad grid to pdf).

    my applicatoin is defined as WebSite under IIS.
    i have a folder (defined outside my application).
    this folder defined under IIS.
    in grid (prometeus) i defined :
    ImageUrl = "http://serverName/FolderName/ImageName.jpg"
    so :
    1.i can create there a picture (it works)
    2.i can show the picture in grid(it works also)
    3.when i try to export grid to pdf :
     There is an error :
    http://serverName/FolderName/ImageName.jpg invalid virtual path

    how can i solve the problem?
    is there some definition (in IIS/WebConfig...) that i am missing??



  9. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 15 Oct 2008 Link to this post

    hi:


    You can use only virtual path. The virtual path provides access to files outside the default directory and subdirectories. It appears in the form ".../~name/..." where "~name" is replaced with actual path configured by the administrator.


    Thank you...
    <John:Peel />
  10. Mira Vaig
    Mira Vaig avatar
    5 posts
    Member since:
    Mar 2008

    Posted 16 Oct 2008 Link to this post

    hello,
    i am sorry - i need more specific example...
    i don't have permition to access IIS , all definitions are done by another team.
    i need to know what i am asking..
    1. "the administrator definishon" - is how myFolder defined in IIS? 
       what is the correct definition?
    3.the ImageUrl must be :
    "../~myFolderNameInIIS/myPicture.jpg"
    am i right?


    thank you
  11. Blaize
    Blaize avatar
    88 posts
    Member since:
    Oct 2006

    Posted 16 Oct 2008 Link to this post

    Hey Mira,
    You could define some setting in the web.config, which will hold the virtual directory path. You could ask the admins for the exact path then... I'm sorry I couldn't get how a more specific example would help - if you don't have access to the IIS you would not be able to run the export example as if it is in real mode...

    As a side note, I'm pretty sure telerik will help once you send them the application?

    Cheers,
    Blaize
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017