Solved

Web Programming , asp.net, sql server

Posted on 2011-09-19
7
230 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now