Quicker Excel

Results 1 to 2 of 2

Thread: Quicker Excel

  1. #1
    Join Date
    Dec 1969

    Default Quicker Excel

    Hi Folks,<BR> At the moment my asp is creating an excel spreadsheet based on reports I am bringing back from the server. Unfortunatel due to the amount of records I am bringing back this is a very long process. At the moment I am writng each line at a time. A bit like this:<BR><BR> set duosdoc = CreateObject("Excel.Sheet") <BR> <BR> With duosdoc.Worksheets("sheet1").Pagesetup<BR> .LeftHeader = _<BR> Chr(10) & "&""Arial,Bold""&8Supplier::" & supplierout & Chr(10) & "Billing Period::" & period & Chr(10) &#039;--& "DUoS Code::" & codeout & Chr(10)<BR> .CenterHeader = "&""Arial,Bold""&11ESB DUoS Charges" <BR> .Zoom = 110<BR> .Orientation = 2<BR> .CenterFooter = "Page &P of &N"<BR> .RightFooter = "&D"<BR> End With<BR> <BR> duosdoc.Worksheets("sheet1").Cells.ColumnWidth = 12.5<BR><BR>For x = 0 to (ubound(ReportArray,1) - 1)<BR> zgc = ReportArray(x,0) <BR> zgc_total = zgc_total + 1 <BR> day_units = ReportArray(x,1)<BR> if not isnumeric(day_units) then<BR> day_units = 0<BR> else<BR> day_units = Round(ReportArray(x,1),0)<BR> day_units_total = day_units_total + day_units<BR> end if<BR><BR>rowcount = rowcount + 1<BR> <BR><BR> duosdoc.Worksheets("sheet1").Range("a" & rowcount).Value = "" & zgc<BR> duosdoc.Worksheets("sheet1").Range("a" & rowcount).HorizontalAlignment = -4108<BR> duosdoc.Worksheets("sheet1").Range("a" & rowcount).Font.Size = 8<BR> duosdoc.Worksheets("sheet1").Range("b" & rowcount).Value = "" & day_units<BR> duosdoc.Worksheets("sheet1").Range("b" & rowcount).HorizontalAlignment = -4108<BR> duosdoc.Worksheets("sheet1").Range("b" & rowcount).Font.Size = 8<BR><BR>next<BR> duosdoc.Worksheets("sheet1").SaveAs "P:DuosFiles\" & supplier & "_" & period & "_" & codeout & ".xls"<BR><BR>This works fine and gives me a snazzy excel report to print out. However I was thinking of using an excel template and writing the data directly into this in order to speed things up. At the moment I am using the range to write the lines. Is there another way to dynamically add the row to the excel file. So that I have my header and then the totals for the end in the template and I can insert the data in between it. Apologies if I&#039;m not making sense because I think I&#039;ve confused myself at this stage. Any help is much appreciated.<BR><BR>Cheers,<BR><BR>Neil<BR><BR><BR >

  2. #2
    Join Date
    Dec 1969

    Default RE: Quicker Excel

    &nbsp;<BR>Why not create the excel template which connects to the data source to get the data you need rather than doing it from asp?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts