Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a report based on passed key

Status
Not open for further replies.

chinedu

Technical User
Mar 7, 2002
241
US
<javascript>

function LaunchReport()
{
var theForm=getForm();
var mySelection = theForm.getSelection();

OBJ_KEYS= new Array();
var FormObjects = mySelection.getFormObjectsEx(null);
for (var i=0; i < FormObjects.size(); i++)
{
var mySelKeys = (FormObjects.item(i).getKey());
OBJ_KEYS = mySelKeys;
}
var newWindow=window.open("}
</script>

Even though above script is javascript, my question is asp related.

I have a form with several little symbols.
These symbols belong to an object on the form.
For instance, the above script is about an object called spills.
There are several symbols that represent various types of spills that can potentially happen in a particular area.
There could be water spills, oil spills, sewer spills, etc.
So each symbol represents each spill type.
A green symbol could represent sewer, red symbol could represent oil and a blue symbol could represent water.
When you click on a symbol, it makes a call to an asp page called points.asp.
This asp page basically selects records from the database where id = object Key. This object key is passed to this asp page by the above javascript script.

So after this javascript makes a call to the asp script, the asp determines whether or not there is a record on the database that matches the key being passed to it.
If there is a match, detailed records relating to the key is displayed.
If there are no records, there is a message indicating so.
So far, so good. This part works great.

Now, I have been asked to do something more challenging to me and I am hoping I can solicit some help from kind experts like you, please.

I am asked to create several objects on this form (It used to be one object).
Each object will have a checkbox and a radio button.

What this means is that if I need to get a record about a particular object, all I need to do is select the checkbox next to that object (This gives selects the object), then check a radio button next to that object (this indicates that I am about to pull a report about this particular object only).

If I then click on a symbol, (again, a key of that object will be passed to the javascript above), the javascript will invoke the asp code which in turn checks the database to see if the record exists.

Here is my problem so far,
I believe I know what to do to solve this problem.
I am just having difficulty approaching a solution.

I need to modify my asp code with a series of IF statements or CASE statements that says when a symbol on a form is clicked and javascript makes a call to this asp form, the first thing the asp form needs to do is determine which object the key belongs to, then verifies if there is a record matching that key.
For instance, if I have 3 objects on my form, let's call them Spills, Accidents, Traffic Counts, when I place a checkmark on a checkbox next to Spills, so far, it makes all the symbols on the form visible.
If I then click on any of the symbols, I will like to see a report of the symbol.

I just don't know how to go about doing this.

If I need to clarify a portion or all of this text, please advise.

I really need help on this.
Thanks to you in advance.
 
yup, i want more clarification and i also suggest u take a look at DOM (Javascript)...

Known is handfull, Unknown is worldfull
 
Can you please tell me what you want more clarification on?
Thanks,
 
how the codes are related, ur post was too long, can i have a better example???

Known is handfull, Unknown is worldfull
 
ok,
I have 2 pages.

First page has a link with a checkbox.

If you click on the checkbox, several little symbols belonging to that link displays all around a form.

If you click on any symbol, it opens a page that contains details of records concerning that symbol.

Let's take auto accident as an example.

We could try to determine the cause of by using symbols.

Red could mean accident was caused by bad weather;
blue symbol could mean accident was caused by failed brake, etc.

So if we click on a blue symbol, I would get detailed report of an accident caused by a failed brake.

So far this part works fine.

Where we are having problem right now is that we wanted to have more than one links with checkboxes and then add a radio button.
This way, we click on accident, symbols relating to accident will display on the form, we could then click on each symbol to get details of that symbol like I explained.
If we decide to click on another link, we just click the checkbox next to that link and only symbols relating to that will display on the form.

Basically, I have several reports.
Rather than create several forms that will display each report, we can to create one one that will contain several reports.

Here is a link I bumped into while surfing for an example to give you.

This example relates to a map but the idea is the same.

On this map example, you will see links or they call them layers on the right hand side.
You can check the one you want to display on the map.
When you check a radio button, you are basically saying you want to obtain a report for that layer.
Do you think you can assist with this?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top