Wrox Home  
Search P2P Archive for: Go

  Return to Index  

application_development thread: Sorting A Report


Message #1 by "Gail Goring" <Gcg@m...> on Tue, 19 Feb 2002 21:37:10
Hi,



I need to write a program that will sort a 300 page report that is 

generated

monthly from an Access database.  The report has 'Key' field in the upper

left-hand corner which is unique.  In the 300-page report each key field

represents 3 or 4 corresponding pages.  When the user selects the specific

key, from a drop-down box, they should only see the pages pertaining to 

that

key field.



More importantly, I have no idea where to begin!



Thank you for your assistance.



Gail
Message #2 by "Whitehead, Crane" <CWhitehead@h...> on Wed, 20 Feb 2002 11:23:30 -0600
Let me start by asking a question.  



Does this 300 page report get created by access and stored into another

table, or does the report use several tables to create the report.



If the data for the report get put into a separate table then you just need

to sort that table before creating the report.  This is fairly simple to do

using filters, sorts or an order by command in the SQL statement.



If it uses several tables to create the report then it will be more

difficult, but it still can be done.



You need to identify where the report is pulling it's data from and which

table contains the data that you want sorted.  Then once again in the report

designer you can specify an order by or sort command to sort the report.

Unfortunately this is not easy, usually I handle this while using the

reports wizard to setup the initial design of the report.  That is the

easiest place to do it.  If the report is already done then you need to find

the data and then determine where to implement your sort.  As I said it can

get tricky depending on how many tables are being used and if the fields to

be sorted reside in one or multiple tables.



I could help more if I could actually see what you were doing and how the

data was being stored.



I know this isn't much help, but hopefully it will get you pointed in the

right direction.



If you have a small database and it's not confidential information then you

could e-mail it to me and I can look at it and see if I can help more.



Thanks







Crane Whitehead

Programmer / Analyst

cwhitehead@h...

xxx.xxx.xxxx

 

Healthaxis

Computing and Network services

http://www.healthaxisasg.com





 -----Original Message-----

From: 	Gail Goring [mailto:Gcg@m...] 

Sent:	Tuesday, February 19, 2002 3:37 PM

Subject:	Sorting A Report



Hi,



I need to write a program that will sort a 300 page report that is 

generated

monthly from an Access database.  The report has 'Key' field in the upper

left-hand corner which is unique.  In the 300-page report each key field

represents 3 or 4 corresponding pages.  When the user selects the specific

key, from a drop-down box, they should only see the pages pertaining to 

that

key field.



More importantly, I have no idea where to begin!



Thank you for your assistance.



Gail-----+----+----+-++--+-+--+---------+---------+----+--------+--+--+-+++-



Subject: ASP won't show properly

From: "Marc Nascimento" <nascimento@r...>

Date: Tue, 19 Feb 2002 21:47:15

Reply-To: "Application Development" <application_development@p...>



OK, here's the situation. 



I created a news database with Microsoft Access, my frist page shows all 

the info the way I want it. Look at 



http://www.ditc-humber.com/summer2001/marcn/noid/



now when I click on one of the articles linked by the More Info... link 

it goes to a page that reads this error



--------------------------------------------------------------------------

The page cannot be displayed 

There is a problem with the page you are trying to reach and it cannot be 

displayed. 



--------------------------------------------------------------------------



Please try the following:



Open the www.ditc-humber.com home page, and then look for links to the 

information you want. 

Click the  Refresh button, or try again later.



Click  Search to look for information on the Internet. 

You can also see a list of related sites. 



HTTP 500 - Internal server error 

Internet Explorer  



--------------------------------------------------------------------------



Here is all the info from the first pages called Featured.asp



<%



' We connect to the recordset to get some information needed in this 

page. and assign them to common variables.



Dim featuredRS

Set featuredRS = Server.CreateObject("ADODB.Recordset")

featuredRS.ActiveConnection = Con

sqlString = "SELECT journal_id, journal_thumbnail, journal_name, 

journal_briefDesc " &_

            "FROM journals WHERE journal_featured=1 " &_

            "AND journal_status=1 " &_

            "ORDER BY journal_name"

featuredRS.Open sqlString

%> <font color="#336699"><b><font color="#666666">Our Featured 

Articles</font></b></font> 

<table border="0" cellpadding="10" cellspacing="0">

  <%count=0%>

  <%

  'a variable named count is made. 

  %>

  <tr> 

    <% WHILE NOT featuredRS.EOF %>

    <td> 

      <table align="center">

        <tr> 

          <td height="30" width="300"> <font color="#336699"><%=featuredRS

("journal_briefDesc")%></font> 

          </td>

        </tr>

        <tr> 

          <td height="25"><a href="journal.asp?jid=<%=featuredRS

("journal_id")%>"><font color="#000000">More 

            Info...</font></a></td>

        </tr>

      </table>

    <td>

	

	 <% 

	 'The code below takes the variable made earlier on the page 

(count) and adds 1 to it each time the code loops. When it

	 'reaches 4 it makes a break and the variable count is set back 

together. It will continue this pattern until 

	 'it finds nothing else to display from the database.

	 %>

	 

      <%  count=count+1

	if count=2 then

	response.write "</tr><tr>"

	count=0

	End if



featuredRS.MoveNext 

WEND

if count<>0 then

response.write "<tr></tr>"

end if

%>

      <div align="center"></div>

    <tr> 

</table>



--------------------------------------------------------------------------



Here's all the info for the journal.asp file (the one that I want to load)



<%

Dim ConnectString

journalID = Request("jid")



Set Con = Server.CreateObject( "ADODB.Connection" )



ConnectString= "Provider=Microsoft.Jet.OLEDB.4.0;" &_

         "Data Source=C:\Inetpub\ditc-humber\summer2001

\Marcn\db\NoID.mdb;" &_

          "Persist Security Info=False" 

         

Con.Open ConnectString    



sqlString = "SELECT * FROM journals "

sqlString = "sqlString & "WHERE journal_id=" & journalID

Set RS = Server.CreateObject( "ADODB.Recordset" )

RS.ActiveConnection = Con

RS.Open sqlString



cat = RS( "journal_category" )

%>



<html>

<head><title>No-ID <%=journalID%> Page</title></head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" 

marginheight="0">

<center>

  <!-- #INCLUDE file="file:header.asp" -->

  <table border="0" width="100%" cellpadding="10" cellspacing="0" 

height="400">

    <tr> 

      <td valign="top" width="125" align="left" height="0"> 

        <!-- #INCLUDE file = "menuList.asp" -->

      </td>

	  

	  <!-- Here the product chosen is showing the picture for it, 

product name for it, description and price for it. -->

      

	  <td width="200" align="center"> <img src="<%=RS

("journal_picture")%>"></td>

      <td valign="top" width="*"> 

        <h2><%=cat%></h2>

        <h3><%=RS("journal_name")%></h3>

        <br>

        <%=RS("journal_fullDesc")%><br>

         

      </td>

    </tr>

  </table>

  <!-- #INCLUDE file="footer.asp" -->

</center>

   </body>

   </html>			



--------------------------------------------------------------------------



Any information would be greatly appreciated. All I want the thing to do 

is load a page with the footer, side and header along with the article 

kept in my Access file to be displayed in the main area. 



Thanks,



Marc Nascimento

nascimento@r...+----+----+-++--+-+--+---------+---------+----+---

-----+--+--+-+++---

Message #3 by <marcpointer@m...> on Wed, 20 Feb 2002 13:42:32 -0500
I think that this was sent to me accidentally...Marc Pointer





Application Development <application_development@p...> wrote:

> Let me start by asking a question.  



Does this 300 page report get created by access and stored into another

table, or does the report use several tables to create the report.



If the data for the report get put into a separate table then you just need

to sort that table before creating the report.  This is fairly simple to do

using filters, sorts or an order by command in the SQL statement.



If it uses several tables to create the report then it will be more

difficult, but it still can be done.



You need to identify where the report is pulling it's data from and which

table contains the data that you want sorted.  Then once again in the report

designer you can specify an order by or sort command to sort the report.

Unfortunately this is not easy, usually I handle this while using the

reports wizard to setup the initial design of the report.  That is the

easiest place to do it.  If the report is already done then you need to find

the data and then determine where to implement your sort.  As I said it can

get tricky depending on how many tables are being used and if the fields to

be sorted reside in one or multiple tables.



I could help more if I could actually see what you were doing and how the

data was being stored.



I know this isn't much help, but hopefully it will get you pointed in the

right direction.



If you have a small database and it's not confidential information then you

could e-mail it to me and I can look at it and see if I can help more.



Thanks







Crane Whitehead

Programmer / Analyst

cwhitehead@h...

xxx.xxx.xxxx

 

Healthaxis

Computing and Network services

http://www.healthaxisasg.com





 -----Original Message-----

From: 	Gail Goring [mailto:Gcg@m...] 

Sent:	Tuesday, February 19, 2002 3:37 PM

Subject:	Sorting A Report



Hi,



I need to write a program that will sort a 300 page report that is 

generated

monthly from an Access database.  The report has 'Key' field in the upper

left-hand corner which is unique.  In the 300-page report each key field

represents 3 or 4 corresponding pages.  When the user selects the specific

key, from a drop-down box, they should only see the pages pertaining to 

that

key field.



More importantly, I have no idea where to begin!



Thank you for your assistance.



Gail-----+----+----+-++--+-+--+---------+---------+----+--------+--+--+-+++-



Subject: ASP won't show properly

From: "Marc Nascimento" 

Date: Tue, 19 Feb 2002 21:47:15

Reply-To: "Application Development" 



OK, here's the situation. 



I created a news database with Microsoft Access, my frist page shows all 

the info the way I want it. Look at 



http://www.ditc-humber.com/summer2001/marcn/noid/



now when I click on one of the articles linked by the More Info... link 

it goes to a page that reads this error



--------------------------------------------------------------------------

The page cannot be displayed 

There is a problem with the page you are trying to reach and it cannot be 

displayed. 



--------------------------------------------------------------------------



Please try the following:



Open the www.ditc-humber.com home page, and then look for links to the 

information you want. 

Click the  Refresh button, or try again later.



Click  Search to look for information on the Internet. 

You can also see a list of related sites. 



HTTP 500 - Internal server error 

Internet Explorer  



--------------------------------------------------------------------------



Here is all the info from the first pages called Featured.asp



 Our Featured 

Articles 



  

  

   

    

     

      

         

            

          

        

         

          <A TARGET="Link" href="journal.asp?jid=<%=featuredRS

("journal_id")%>">More 

            Info...</A>

        

      

    

	

	 

	 

      "

	count=0

	End if



featuredRS.MoveNext 

WEND

if count0 then

response.write ""

end if

%>

      

     





--------------------------------------------------------------------------



Here's all the info for the journal.asp file (the one that I want to load)









No-ID  Page





  

  

     

       

        

      

	  

	  

      

	   ">

       

        

        

        

> 

        

> 

         

      

    

  

  



   

   			



--------------------------------------------------------------------------



Any information would be greatly appreciated. All I want the thing to do 

is load a page with the footer, side and header along with the article 

kept in my Access file to be displayed in the main area. 



Thanks,



Marc Nascimento

nascimento@r...+----+----+-++--+-+--+---------+---------+----+---

-----+--+--+-+++---








Message #4 by "Gail Goring" <Gcg@m...> on Fri, 22 Feb 2002 15:01:49
The report I will be working with is the end product after the report 

wizard has sorted the data from the tables.  Someone else creates the 

report, I have the static copy to work from.  The goal is to place the 

report our Intranet, but each subscetion of the need to be viewable 

without going through the entire report.  If subsection 'tires' is on page 

144 only, the user needs to be able to go the tire section with looking at 

pages 1 - 143. 



Thank you again.



Gail   









> Let me start by asking a question.  

> 

> Does this 300 page report get created by access and stored into another

> table, or does the report use several tables to create the report.

> 

> If the data for the report get put into a separate table then you just 

need

> to sort that table before creating the report.  This is fairly simple to 

do

> using filters, sorts or an order by command in the SQL statement.

> 

> If it uses several tables to create the report then it will be more

> difficult, but it still can be done.

> 

> You need to identify where the report is pulling it's data from and which

> table contains the data that you want sorted.  Then once again in the 

report

> designer you can specify an order by or sort command to sort the report.

> Unfortunately this is not easy, usually I handle this while using the

> reports wizard to setup the initial design of the report.  That is the

> easiest place to do it.  If the report is already done then you need to 

find

> the data and then determine where to implement your sort.  As I said it 

can

> get tricky depending on how many tables are being used and if the fields 

to

> be sorted reside in one or multiple tables.

> 

> I could help more if I could actually see what you were doing and how the

> data was being stored.

> 

> I know this isn't much help, but hopefully it will get you pointed in the

> right direction.

> 

> If you have a small database and it's not confidential information then 

you

> could e-mail it to me and I can look at it and see if I can help more.

> 

> Thanks

> 

> 

> 

> Crane Whitehead

> Programmer / Analyst

> cwhitehead@h...

> xxx.xxx.xxxx

>  

> Healthaxis

> Computing and Network services

> http://www.healthaxisasg.com

> 

> 

>  -----Original Message-----

> From: 	Gail Goring [mailto:Gcg@m...] 

> Sent:	Tuesday, February 19, 2002 3:37 PM

> Subject:	Sorting A Report

> 

> Hi,

> 

> I need to write a program that will sort a 300 page report that is 

> generated

> monthly from an Access database.  The report has 'Key' field in the upper

> left-hand corner which is unique.  In the 300-page report each key field

> represents 3 or 4 corresponding pages.  When the user selects the 

specific

> key, from a drop-down box, they should only see the pages pertaining to 

> that

> key field.

> 

> More importantly, I have no idea where to begin!

> 

> Thank you for your assistance.

> 

> Gail-----+----+----+-++--+-+--+---------+---------+----+--------+--+--+-

+++-

> 

> Subject: ASP won't show properly

> From: "Marc Nascimento" <nascimento@r...>

> Date: Tue, 19 Feb 2002 21:47:15

> Reply-To: "Application Development" 

<application_development@p...>

> 

> OK, here's the situation. 

> 

> I created a news database with Microsoft Access, my frist page shows all 

> the info the way I want it. Look at 

> 

> http://www.ditc-humber.com/summer2001/marcn/noid/

> 

> now when I click on one of the articles linked by the More Info... link 

> it goes to a page that reads this error

> 

> -------------------------------------------------------------------------

-

> The page cannot be displayed 

> There is a problem with the page you are trying to reach and it cannot 

be 

> displayed. 

> 

> -------------------------------------------------------------------------

-

> 

> Please try the following:

> 

> Open the www.ditc-humber.com home page, and then look for links to the 

> information you want. 

> Click the  Refresh button, or try again later.

> 

> Click  Search to look for information on the Internet. 

> You can also see a list of related sites. 

> 

> HTTP 500 - Internal server error 

> Internet Explorer  

> 

> -------------------------------------------------------------------------

-

> 

> Here is all the info from the first pages called Featured.asp

> 

> <%

> 

> ' We connect to the recordset to get some information needed in this 

> page. and assign them to common variables.

> 

> Dim featuredRS

> Set featuredRS = Server.CreateObject("ADODB.Recordset")

> featuredRS.ActiveConnection = Con

> sqlString = "SELECT journal_id, journal_thumbnail, journal_name, 

> journal_briefDesc " &_

>             "FROM journals WHERE journal_featured=1 " &_

>             "AND journal_status=1 " &_

>             "ORDER BY journal_name"

> featuredRS.Open sqlString

> %> <font color="#336699"><b><font color="#666666">Our Featured 

> Articles</font></b></font> 

> <table border="0" cellpadding="10" cellspacing="0">

>   <%count=0%>

>   <%

>   'a variable named count is made. 

>   %>

>   <tr> 

>     <% WHILE NOT featuredRS.EOF %>

>     <td> 

>       <table align="center">

>         <tr> 

>           <td height="30" width="300"> <font color="#336699"><%

=featuredRS

> ("journal_briefDesc")%></font> 

>           </td>

>         </tr>

>         <tr> 

>           <td height="25"><a href="journal.asp?jid=<%=featuredRS

> ("journal_id")%>"><font color="#000000">More 

>             Info...</font></a></td>

>         </tr>

>       </table>

>     <td>

> 	

> 	 <% 

> 	 'The code below takes the variable made earlier on the page 

> (count) and adds 1 to it each time the code loops. When it

> 	 'reaches 4 it makes a break and the variable count is set back 

> together. It will continue this pattern until 

> 	 'it finds nothing else to display from the database.

> 	 %>

> 	 

>       <%  count=count+1

> 	if count=2 then

> 	response.write "</tr><tr>"

> 	count=0

> 	End if

> 

> featuredRS.MoveNext 

> WEND

> if count<>0 then

> response.write "<tr></tr>"

> end if

> %>

>       <div align="center"></div>

>     <tr> 

> </table>

> 

> -------------------------------------------------------------------------

-

> 

> Here's all the info for the journal.asp file (the one that I want to 

load)

> 

> <%

> Dim ConnectString

> journalID = Request("jid")

> 

> Set Con = Server.CreateObject( "ADODB.Connection" )

> 

> ConnectString= "Provider=Microsoft.Jet.OLEDB.4.0;" &_

>          "Data Source=C:\Inetpub\ditc-humber\summer2001

> \Marcn\db\NoID.mdb;" &_

>           "Persist Security Info=False" 

>          

> Con.Open ConnectString    

> 

> sqlString = "SELECT * FROM journals "

> sqlString = "sqlString & "WHERE journal_id=" & journalID

> Set RS = Server.CreateObject( "ADODB.Recordset" )

> RS.ActiveConnection = Con

> RS.Open sqlString

> 

> cat = RS( "journal_category" )

> %>

> 

> <html>

> <head><title>No-ID <%=journalID%> Page</title></head>

> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" 

> marginheight="0">

> <center>

>   <!-- #INCLUDE file="file:header.asp" -->

>   <table border="0" width="100%" cellpadding="10" cellspacing="0" 

> height="400">

>     <tr> 

>       <td valign="top" width="125" align="left" height="0"> 

>         <!-- #INCLUDE file = "menuList.asp" -->

>       </td>

> 	  

> 	  <!-- Here the product chosen is showing the picture for it, 

> product name for it, description and price for it. -->

>       

> 	  <td width="200" align="center"> <img src="<%=RS

> ("journal_picture")%>"></td>

>       <td valign="top" width="*"> 

>         <h2><%=cat%></h2>

>         <h3><%=RS("journal_name")%></h3>

>         <br>

>         <%=RS("journal_fullDesc")%><br>

>          

>       </td>

>     </tr>

>   </table>

>   <!-- #INCLUDE file="footer.asp" -->

> </center>

>    </body>

>    </html>			

> 

> -------------------------------------------------------------------------

-

> 

> Any information would be greatly appreciated. All I want the thing to do 

> is load a page with the footer, side and header along with the article 

> kept in my Access file to be displayed in the main area. 

> 

> Thanks,

> 

> Marc Nascimento

> nascimento@r...+----+----+-++--+-+--+---------+---------+----

+---

> -----+--+--+-+++---


  Return to Index