Solved

Web Programming , asp.net, sql server

Posted on 2011-09-19
7
240 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

932 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

9 Experts available now in Live!

Get 1:1 Help Now