printing gridweb content from excel not working(ver aspose-2.5.3.2006)

Last post 08-25-2011, 9:38 PM by mshakeel.faiz. 13 replies.
Sort Posts: Previous Next
  •  07-12-2011, 1:47 AM 315777

    printing gridweb content from excel not working(ver aspose-2.5.3.2006) .NET

    Attachment: Present (inaccessible)

    Hi,

    The above code works fine (printing the content in the excel sheet from the browser IE9) if I run my project locally (http://localhost:2627/tech_23june2011/Default.aspx) . But if I run remotely (http://10.10.210.97/tech_23june2011/Default.aspx) it throws error Aspose.cells.CellsException :  Default printer is not set . Printer not found! For the error message please find the attached file.

    The problem is : when the client click the print button , the serverside code cannot find the client’s default printername or path. I don’t know how to find client default printer name with path.

     Can you please suggest a solution for this? Its very very urgent.

     Code: 

    string filename = "c:\\one.xls";            // Saves to the file.    

             this.g.WebWorksheets.SaveToExcelFile(filename);             // Sents the file to browser.       

         Response.ContentType = "application/vnd.ms-excel";             //Adds header.            Response.AddHeader("content-disposition", "attachment; filename=book1.xls");             // Writes file content to the response stream.           

    Response.WriteFile(filename);             // OK.            //Response.End();             //  string filename = "c:\\one.xls";       

         Workbook workbook = new Workbook();           

    workbook.Open(filename);            //Page settings          

      workbook.Worksheets[0].PageSetup.FitToPagesWide = 1;  

              workbook.Worksheets[0].PageSetup.Orientation = PageOrientationType.Landscape;            workbook.Worksheets[0].PageSetup.PaperSize = PaperSizeType.PaperA3;            workbook.Worksheets[0].PageSetup.HeaderMargin = 0.7;         

       workbook.Worksheets[0].PageSetup.TopMargin = 1.1;       

         workbook.Worksheets[0].PageSetup.LeftMargin = 0.9;            workbook.Worksheets[0].PageSetup.RightMargin = 0.9;      

          workbook.Worksheets[0].PageSetup.BottomMargin = 0.8; 

               workbook.Worksheets[0].PageSetup.FooterMargin = 0.5;            //Add NT logo in the A1 cell of the excel sheet         

       workbook.Worksheets[0].Pictures.Add(0, 0, @"C:\inetpub\wwwroot\tech_23june2011\Images\NTLogo3.gif");         

       workbook.Save(filename);    

            PrinterSettings settings = new PrinterSettings();  

              workbook.Worksheets[0].SheetToPrinter(settings.PrinterName); 

     Many Thanks,

    Assal.

    Filed under: Aspose gridweb
     
  •  07-12-2011, 4:13 AM 315826 in reply to 315777

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006)

    Hi,

    Thanks for reporting this problem.

    I have logged your issue in our database. We will investigate your problem and update you asap.

    This issue has been logged as CELLSNET-29087.

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  07-12-2011, 3:33 PM 316001 in reply to 315826

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006) .NET

    Hi,

    Have got any updates?

    Many Thanks,
    Assal
    Filed under: aspose gridweb
     
  •  07-12-2011, 9:23 PM 316029 in reply to 316001

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006)

    Hi,

    The problem is : when the client click the print button , the serverside code cannot find the client’s default printername or path. I don’t know how to find client default printer name with path.

    It’s impossible that directly printing file on the server to the client.

    As gridweb could not support pagesetup, please export the file to image on the server with Aspose.Cells, send the images to the client, then print the images to the printer on the client.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  07-13-2011, 2:43 AM 316059 in reply to 316029

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006) .NET

    Hi,

    Question 1:When user clicks the print button, the content from the Gridweb controls has converted in to excel file with formatting in client's local machine successfully.But how to print that excel file (ie) how to find default printer name.

    workbook.Open("c:\\one.xls");    

                     workbook.Worksheets[0].SheetToPrinter(PrinterName);


    Question 2:  In the "Aspose.pdf for .net"  product you have shown how to print the pdf file in the default printer using PdfViewer class(http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/printing-pdf-file-to-default-printer-using-printer-and-page-settings-facades.html). Similarly can you please tell me how to print the Excel file in the default printer using "Aspose.Cells.GridWeb" or "Aspose.Cells" product.


    Many Thanks,

    Assal








    Filed under: Aspose.Cells.GridWeb
     
  •  07-14-2011, 1:06 AM 316299 in reply to 316059

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006) .NET

    Hi,
    Have you got any updates on this please? Its urgent please.

    Many Thanks,
    Assal
    Filed under: Aspose.Cells.GridWeb
     
  •  07-14-2011, 5:00 AM 316357 in reply to 316299

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006)

    Hi,

    I have added your question and requirement in our database. We will update you once we will get some update regarding it. Thanks for your patience.

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  07-18-2011, 2:42 AM 316833 in reply to 316357

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006) .NET

    Hi,
    Have you got any updates ? It is urgent requirement please

    Many Thanks,
    Assal.
    Filed under: Aspose.Cells.GridWeb
     
  •  07-18-2011, 6:51 AM 316889 in reply to 316833

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006)

    Hi,

    Unfortunately, there is no update. I have increased the priority and also added your comment. Thanks for your patience.

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  07-18-2011, 8:40 PM 317056 in reply to 316833

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006)

    Attachment: Present (inaccessible)
    Hi,

    The attached demo illustrates how to use Aspose.Cells to render image on a browser on server side.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  08-11-2011, 9:24 AM 321839 in reply to 317056

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006)

    Attachment: Present (inaccessible)
    Hi ,

    I tried your method for printing, but the below properties are not set. When i take the printout the image quality is not good and it is very small.

    sheet.PageSetup.FitToPagesWide = 1;

           sheet.PageSetup.Orientation = PageOrientationType.Landscape;

          sheet.PageSetup.PaperSize = PaperSizeType.PaperA4;

          sheet.PageSetup.HeaderMargin = 0.7;

          sheet.PageSetup.TopMargin = 1.1;

          sheet.PageSetup.LeftMargin = 0.9;

          sheet.PageSetup.RightMargin = 0.9;

          sheet.PageSetup.BottomMargin = 0.8;

          sheet.PageSetup.FooterMargin = 0.5;

    I've attached my sample code and excel file to be printed. Can you please suggest any solution for this please?

    (Run my printing.aspx file )

    This feature is very important in out development.

    Please check and reply me as soon as possible

    Thanks in advance

     
  •  08-15-2011, 2:10 AM 322242 in reply to 321839

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006) .NET

    Hi there,
    Have you got any updates please? It is urgent please.

    Many Thanks,
    Assal
    Filed under: Aspose GridWeb
     
  •  08-21-2011, 5:39 PM 323560 in reply to 322242

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006) .NET

    Hi,
    Have you got any updates? It is very urgent. This is the only one functionality we are lagging in our project.  Please help us to solve the issue as soon as possible.

    Many Thanks,
    Assal
    Filed under: Aspose Gridweb
     
  •  08-25-2011, 9:38 PM 324646 in reply to 323560

    Re: printing gridweb content from excel not working(ver aspose-2.5.3.2006)

    Hi,

    Please try the demo code using the latest version: Aspose.Cells.GridWeb v2.6.1.2002 and let us know your feedback.

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML