SolutionsIn.Net
New Member
- Joined
- Jan 24, 2008
- Messages
- 1
I have a vb.net asp.net application.
The user wants to print labels from the database.
All well and good...
to do this I built a datagrid and exported the data using vb.net code
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim objStringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim objHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(objStringWriter)
grdLabels.RenderControl(objHtmlTextWriter)
Response.Write(objStringWriter.ToString())
Response.End()
Then I build a standalone workbook using the info found in
http://www.mrexcel.com/tip081.shtml
Next in a 2nd workbook
Use the import to get the data from the web download workbook
Then run the merge data to label job
And the user can print the labels from Excel on there workstation
THIS WORKS - BUT I HAVE 2 QUESTIONS
QUESTION 1
From VB.Net (ASP.Net) code can I pre select the default location that the exported data would be placed - so all the user has to do is press the Save button in the File Download dialog - and they do not see the Save As dialog window and have to enter information for both the Save In: and File Name:
QUESTION 2
After the WEB data worksheet get saved to the user workstation is there a way via code from the ASP side that I could go into the workbook and add the formated label worksheet and the vba code and button to the workbook so that the user can do everything form one new workbook and not 2 workbooks
OR
Is there a way to place the label workbook on the ASP server and on demand download this to the users workstation and push in the new data then the user would only have one workbook with the current data and would not have to run the import data function into the label workbook
Any ideas or specific code would be appreacated.
Again this works but I do not thinks supporting the user with 2 workbooks is the best solution
Thanks
Jim House
The user wants to print labels from the database.
All well and good...
to do this I built a datagrid and exported the data using vb.net code
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim objStringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim objHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(objStringWriter)
grdLabels.RenderControl(objHtmlTextWriter)
Response.Write(objStringWriter.ToString())
Response.End()
Then I build a standalone workbook using the info found in
http://www.mrexcel.com/tip081.shtml
Next in a 2nd workbook
Use the import to get the data from the web download workbook
Then run the merge data to label job
And the user can print the labels from Excel on there workstation
THIS WORKS - BUT I HAVE 2 QUESTIONS
QUESTION 1
From VB.Net (ASP.Net) code can I pre select the default location that the exported data would be placed - so all the user has to do is press the Save button in the File Download dialog - and they do not see the Save As dialog window and have to enter information for both the Save In: and File Name:
QUESTION 2
After the WEB data worksheet get saved to the user workstation is there a way via code from the ASP side that I could go into the workbook and add the formated label worksheet and the vba code and button to the workbook so that the user can do everything form one new workbook and not 2 workbooks
OR
Is there a way to place the label workbook on the ASP server and on demand download this to the users workstation and push in the new data then the user would only have one workbook with the current data and would not have to run the import data function into the label workbook
Any ideas or specific code would be appreacated.
Again this works but I do not thinks supporting the user with 2 workbooks is the best solution
Thanks
Jim House