• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

Web Programming , asp.net, sql server

I have an application, on a button click it generates a csv report file. I save this report and its settings
to a table in the database. I need an mechanism to keep track of these report, meaning in the table they are
saved with a unique UserID and time and date they ran the report and its settings. But instead of date and time
i want to keep a counter for these reports for each user.Also, on a button click i want to first prompt if
they user wants to save this report settings with a name they choose, if they don't give a name, just save it
with a unique id or name generated.
0
singsunn
Asked:
singsunn
  • 4
  • 3
1 Solution
 
FarWestCommented:
sorry; can you explain further, and what exactly the problem to do what you want?
btw: you flagged it in web services zone, do you mean you need a web service to do that?
is the original application a windows form, or asp.net?
0
 
singsunnAuthor Commented:
sorry about that. Application is in asp.net.
I have a aspx page in my website,where user can generate their reports. Users can select the data they want to
see in their report and hit a button. All the data they selected, which are the column name from a table,
are dumped to a csv file. At the same time, the settings they chose or the column they selected are saved as
settings in another table, which they can view later. Right now, i save these settings with a default name (
eg report_9/19/2011) and settings (column names) in the table. but i want to make it more like a counter such as (report 1,
report 2 and so on). Also when they hit generate report button, i want to prompt them if they want to save
it with a different name. I'm not sure if a javascript can do this or do i have to do this in the code behind.
0
 
FarWestCommented:

Regarding a unique Counter, per user, per run then you need to add a field in  the table for the counter
when you save it you just select max(counterfiled) + 1 for the current user, and then use it as a name, (this is the simplest if you also assume that the same user is not opening this form from multible browsers/computers)

regarding accepting the user input for a new name, please read this link
http://www.dotnetbips.com/articles/fb517596-9838-454b-b65d-999a7bb78445.aspx
so the form that will be displayed in the page will be a simple  .aspx contain the input field, and in the code behind you just set the field value to a session variable, and then use it in your report generation page

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
singsunnAuthor Commented:
Thank you for the reply. one more question is can a button click event be tied with both server side and javascript methods? I need to pop up the message if they want to save the file with a different name and after they hit ok or cancel i need to proceed with the server side button click method?
0
 
FarWestCommented:
yes you can use something like control.PostBackUrl="~/reportPage.aspx" property.
but I think there is a better solution, using the original page add a textbox that contains your generated name and allow the user to change it if he wants to, then no need to make dialog, and if you want to inhance this you can add checkbox to enable reportname textbox or disable it "User differnet name:" for example

0
 
singsunnAuthor Commented:
Thank you. Regarding the first issue of a counter. I will have to maintain a counter for each user in the database?
0
 
FarWestCommented:
yes, and you can use max(counterfield) + 1 to have a value for the new inserted rows
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now