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.
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")
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...
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
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..
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.
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?
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...
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.
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!
Bookmarks