I write code for export grid data to excel and print.
Its working fine on my local computer. when i upload source code on server its not working at all.
Please help me. What to do ?
Thanks,
Rajnikant
3 Answers, 1 is accepted
Most probably the application does not have enough rights to save the file on the server. You can try local export/print similar to our latest demos:
http://demos.telerik.com/silverlight/beta/#GridView/Exporting (Save as file directly)
http://demos.telerik.com/silverlight/beta/#GridView/Printing (PrintToHtml() method)
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I wanted to use your gridview's print feature. but the link you give does not work.
http://demos.telerik.com/silverlight/beta/#GridView/Printing (PrintToHtml() method)
Your new printing link has some problems; it only works for first time. ( PrintAndExportWithRadDcument )
In first time,
Printing page opens and shows me a dialog. If I click cancel, it closes that dialog successfully.
After, the second time; Print button does not work. Does nothing.
Can you help me to find out what is the problem?
Thank you,
Sarper
We've fixed this issue immediately and the fix will be part of our next demos upload. In the meantime here is how to fix it at your end:
PrintAndExportWithRadDocumentModel.cs
...............................................................................
public void Print(object parameter)
{
RadGridView grid = (RadGridView)parameter;
RadRichTextBox rtb = null;
string rtBname = "RadRichTextBox1";
Grid parent = grid.ParentOfType<Grid>();
if (parent != null)
{
if (parent.FindName(rtBname) == null)
{
rtb = new RadRichTextBox() { Height = 0 };
rtb.Name = rtBname;
parent.Children.Add(rtb);
rtb.ApplyTemplate();
}
else
{
rtb = parent.FindName(rtBname) as RadRichTextBox;
}
}
if (rtb != null)
{
rtb.Dispatcher.BeginInvoke((Action)(() =>
{
rtb.Document = CreateDocument(grid);
}));
rtb.Print("MyDocument", Documents.UI.PrintMode.Native);
}
}
I've added 1000 Telerik points to your account.
Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.