This is a migrated thread and some comments may be shown as answers.

Problem exporting radgrid(promiteus) to PDF

9 Answers 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mira Vaig
Top achievements
Rank 1
Mira Vaig asked on 04 Jun 2008, 05:46 AM

 

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

 

9 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Jun 2008, 07:28 AM
Hi Mira,

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

Thanks
Shinu.
0
Mira Vaig
Top achievements
Rank 1
answered on 04 Jun 2008, 08:00 AM
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.

0
plamen
Top achievements
Rank 1
answered on 09 Jun 2008, 10:12 AM
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 />
0
Mira Vaig
Top achievements
Rank 1
answered on 11 Jun 2008, 03:58 AM
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?
0
plamen
Top achievements
Rank 1
answered on 11 Jun 2008, 06:33 AM
hi

You can save the image in temp file

Hope this helps...
<John:Peel />
0
Mira Vaig
Top achievements
Rank 1
answered on 15 Oct 2008, 09:02 AM
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??



0
plamen
Top achievements
Rank 1
answered on 15 Oct 2008, 11:43 AM
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 />
0
Mira Vaig
Top achievements
Rank 1
answered on 16 Oct 2008, 07:21 AM
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
0
Blaize
Top achievements
Rank 1
answered on 16 Oct 2008, 02:56 PM
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
Tags
Grid
Asked by
Mira Vaig
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mira Vaig
Top achievements
Rank 1
plamen
Top achievements
Rank 1
Blaize
Top achievements
Rank 1
Share this question
or