CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2011
    Posts
    15

    VB.net, ASP.net error

    Hi everyone,
    I hope you could help me with my problem
    I am a fresh graduate and I am working now as a developer in a good company
    By the way, I am not the one who developed this tool, it's the previous programmer and they gave the project to me to update it
    however, when I try to run the application in my local computer I am getting this error:

    Argument not specified for parameter 'XLSFile' of 'Public Sub New(XMLFile As String, XLSFile As String)'.

    The error points to the code below in bold letter:
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Zym.ConnectionString = Web.Configuration.WebConfigurationManager.ConnectionStrings("cnworkload").ConnectionString
    'Dim cn As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(Zym.ConnectionString)
    'Dim DA As New System.Data.SqlClient.SqlDataAdapter("SELECT * FROM SUMMARY_WORKLOAD", cn)
    'Dim DS As System.Data.DataSet = New System.Data.DataSet
    Try
    excel = New zymClass.myCustomClass.Excel(Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx") excel.ConnectionString=Web.Configuration.WebConfigurationManager.ConnectionStrings("cnworkload").ConnectionString
    excel.STRSQL = "SELECT * FROM SUMMARY_WORKLOAD"
    excel.Connect()
    'cn.Open()
    'DA.Fill(DS)
    'excel.ExportRawData(DS)
    excel.Sheetname = "RAW DATA"
    excel.SetPageField("CORPORATE")
    excel.SetRowField("BUSGROUP", "TEAM")
    excel.SetRowName("Business Group or Corporate", "Team")
    excel.SetRowSummary(True, False)
    excel.SetRowGrandtotal(False)
    excel.SetColumnField("YEAR", "MONTH")
    excel.SetColumnName("Year", "Month")
    excel.SetColumnSummary(False, False)
    excel.SetColumnGrandtotal(False)
    excel.SetDataField("Hours")
    excel.SetDataName("Count of Hours")
    excel.SetDataFormat("0")
    excel.SetDataConsolidation(Microsoft.Office.Interop.Excel.XlConsolidationFunction.xlCount)
    excel.ExportPivot("OLEDB;Provider=SQLOLEDB;", excel.STRSQL, "Workload Data")
    Catch ex As Exception
    End Try
    Zym.ZipFile(" /C zip """ & HttpContext.Current.Server.MapPath("~/export/exportpivot.zip") & """ """ & HttpContext.Current.Server.MapPath("~/export/exportpivot.xlsx") & """", HttpContext.Current.Server.MapPath("~/export"))
    Response.Redirect("FILE.ASPX")
    End Sub


    I really hope someone can help me, I already said to myself that crying is not the key to solve this ....
    Thank you very much in advance and tell me if you need to see the whole .aspx and .vb code so that I can provide you.

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: VB.net, ASP.net error

    Well the answer is staring you in the face ....

    Obviously your nervous and did not sleep well ...

    Argument not specified for parameter 'XLSFile'
    for
    Code:
    Public Sub New(XMLFile As String, XLSFile As String)
    and your calling the sub with
    Code:
    excel = New zymClass.myCustomClass.Excel(Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")
    The new function is expecting 2 variables and your code is serving up one...

    the next piece is only guess work however i'd say use
    Code:
    excel = New zymClass.myCustomClass.Excel("" , Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")
    for the line, and it should get passed this error... however we dont know what it is expecting there.. so it may cause other errors....

    Gremmy...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Feb 2011
    Posts
    15

    Question Re: VB.net, ASP.net error

    Hello GremlinSA,
    You're right, I am nervous and I'm out of my mind . .. yes I now understand that I am lacking another argument, and I don't know whether it is the xml file or xlsx file. The previous developer gave me the applcation files with the .xlsx file but without the .xml file do you think it is because of that? and the code you gave me
    excel = New zymClass.myCustomClass.Excel("" , Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")
    did throw the error away, however I have another error:
    Too many arguments to 'Public Sub ExportPivot(cnPrefix As String, strsql As String)'.
    The error points to the code "Workload data in"
    excel.ExportPivot("OLEDB;Provider=SQLOLEDB;", excel.STRSQL, "Workload Data")

  4. #4
    Join Date
    Feb 2011
    Posts
    15

    Re: VB.net, ASP.net error

    I forgot to thank you GremlinSA, thanks genius! but my problem is not yet solved

  5. #5
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: VB.net, ASP.net error

    well looking at this one .. i'd say drop the "Workload Data" parameter and see what happens...

    However i get the strange feeling that you may be working with a older version of the component...

    That's problem i'm currently facing.. can only find Source code for 3 or 4 versions previous to current running components...

    I hope you have a backup of the original source as you may need to go back to it if the latest sub component is an older version and you have to revert all these changes...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  6. #6
    Join Date
    Feb 2011
    Posts
    15

    Re: VB.net, ASP.net error

    Hi GremlinSA,
    Okay, hmmm this is what happened, I replaced the code
    excel = New zymClass.myCustomClass.Excel( Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")
    to
    excel = New zymClass.myCustomClass.Excel("" , Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")

    and then
    dropped "Workload Data" parameter

    all the errors finally vanished..
    but..
    the reporting functionality is not working anymore
    this is sad

  7. #7
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: VB.net, ASP.net error

    I suggest you search the servers and other developer systems for other versions of the 'zymClass', and i'm almost sure you'll find one newer than the one your working with..

    Other than that , go back to your boss, and tell them that the source you have is outdated and you cant provide support for it, until they provide you with the latest..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  8. #8
    Join Date
    Feb 2011
    Posts
    15

    Re: VB.net, ASP.net error

    Thank you GermlinSA for the kind support. I will not close this thread yet until I solve this problem though, but I appreciate your help! If ever an idea popped in your mind regarding this, please kindly inform me,
    again thank you very much.

  9. #9
    Join Date
    Feb 2011
    Posts
    15

    Re: VB.net, ASP.net error

    Hi another update,
    I don't know if this is an error or a notification, I also don't know if this is related to my problem, but when I tried to run the application,
    a messagebox appeared saying:
    "This report...was saved in a previous version of Crystal Reports using an older report file format. If this report is re-saved in the current version, the report file format will be upgraded to a new file format, causing it to be unusable in previous versions of Crystal Reports...Do you want to upgrade the report to the new file format?"
    Should I click Yes or No?

    Thanks!

  10. #10
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: VB.net, ASP.net error

    This is one of those.. Hmmmmm just what i thought moments..

    In all honesty it's personal preferance to select yes/no ... however if your code needs to reopen the files.. (it does not create a new report every time it runs) you need to select no...

    Try and find a system where the software (before you altered it) is running and use it as a benchmark .. Note things like .. OS ver, Crystal Reports ver, Date stamps on EXE's and Dll's .. and compare to what you got on the Dev system ...

    50% of software dev is running around trying to get all the right info needed...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  11. #11
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: VB.net, ASP.net error

    Where i'm currently stationed... I spent 2 months with system operators and data captures investigating how the current system ran, before i wrote/ rewrote one line of code...

    You need to know the operating proccess before you can write code to perform it.
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  12. #12
    Join Date
    Feb 2011
    Posts
    15

    Re: VB.net, ASP.net error

    Okay GremlinSA I will try to retrieve the laptop where he developed this application to know the version of the OS, Crystal report etc.
    and if still I cannot find the solution to this, I think I may have to re-create the reporting and exporting to excel functionalities which will cost me additional workload , it's still great that other functionalities like adding,deleting,editing is still working fine.
    atleast now, I have a clear vision of what the error is all about.
    Thank you! again, if you still have ideas in your mind, please don't hesitate to tell me..
    I will mark this thread as done after I find the specific solution to my problem.
    thanks a ton!

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured