0

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
[B]excel = New zymClass.myCustomClass.Excel(Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx") [/B]
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.
.

Edited by __avd: Added [code] tags.

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by aplee
0

Basically, the sub routine being used needs 2 parameters passed to it, in order to work correctly.

The two parameters from your code are XMLFile and XLSFile, XLSFile is missing.

My guess would be that

excel = New zymClass.myCustomClass.Excel(Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")

The file in question probably doesn't exist, or the path to the directory is different from usual, check these things first.

- Jordan

0

Hi JJCollins,

hmmm, I think the program cannot see the ExportPivot.xlsx?,or is it the xml file that is missing? I dont see any xml file here in the application folder that was given to me by the previous developer but there is a .xlsx file located in visual studio 2008/projects/workloadtool/Export/ExportPivot.xlsx \
Could it also be that the program cannot find the .xlsx file?

Thank you very much genius!

0

It's probably missing because you're running it locally, if it's been running on a server then the path to the .xlsx file will be different to your local machine, so my guess is that it can't find the directory to the file :)

- Jordan

Edited by JJCollins: n/a

0

Hi Jordan,
Just to throw away the error, i replaced this code

excel = New zymClass.myCustomClass.Excel(Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")

to this code

excel = New zymClass.myCustomClass.Excel("", Server.MapPath(Request.ApplicationPath) & "\Export\ExportPivot.xlsx")

and replaced this code

excel.ExportPivot("OLEDB;Provider=SQLOLEDB;", excel.STRSQL, "Workload Data")

to this code

excel.ExportPivot("OLEDB;Provider=SQLOLEDB;", excel.STRSQL)

the error went away,
however

the export to excel functionality including the view report (crystal reports) is not working properly anymore. :(

and I got confused with this

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?

Thank you!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.