Solved

Web Programming , asp.net, sql server

Posted on 2011-09-19
7
253 Views
Last Modified: 2012-05-12
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
Comment
Question by:singsunn
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:FarWest
ID: 36560671
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
 

Author Comment

by:singsunn
ID: 36560875
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
 
LVL 12

Expert Comment

by:FarWest
ID: 36561101

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:singsunn
ID: 36561768
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
 
LVL 12

Accepted Solution

by:
FarWest earned 500 total points
ID: 36562131
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
 

Author Comment

by:singsunn
ID: 36562606
Thank you. Regarding the first issue of a counter. I will have to maintain a counter for each user in the database?
0
 
LVL 12

Expert Comment

by:FarWest
ID: 36565056
yes, and you can use max(counterfield) + 1 to have a value for the new inserted rows
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question