Solved

Generic file containing the Company Listing - passed to multiple pages

Posted on 2004-04-06
4
212 Views
Last Modified: 2008-02-01
I use Crystal Reports to manage data from a SQL database. The reports are then converted into ASP pages to make the more accessible.
Over 20 of these reports have Date and Company ID parameters. I am not able to build the Company ID list from values in the database because of permissions... I build the list by setting default values from the .rpt file and then I pass those to the Parameters prompt page. I manually have to update all CompanyID listings, but I know I can have an include file in XML or some other way, where I can call that file to pour those values into the Select statement.

The statment looks something like this:

 <td>
            <select name="P2" size="10">
                 <option value="ABS">ABS
                 <option value="AILA">AILA
                 <option value="AL BETZ">AL BETZ
                 <option value="AL BETZ_TRAININ">AL BETZ_TRAININ
                 <option value="AQUARIUM PROD">AQUARIUM PROD
                 <option value="ARHD">ARHD
                 <option value="ARHD_ADMIN">ARHD_ADMIN
                 <option value="ARMOR INS">ARMOR INS
                 <option value="AVANSIS">AVANSIS
                 <option value="BITS">BITS
                 <option value="BMA">BMA
                 <option value="BOB HARTWICK">BOB HARTWICK
                 <option value="BONSAL">BONSAL
                 <option value="CANATELLA">CANATELLA
                 <option value="CARSON NEWSOME">CARSON NEWSOME
                 <option value="CASEY FAM SVCS">CASEY FAM SVCS
                 <option value="CASEY FAM_TRNG">CASEY FAM_TRNG
                 <option value="CAYCE">CAYCE
                 <option value="CCP">CCP
                 <option value="CHUCK NEWHALL">CHUCK NEWHALL
                 <option value="COLUMBIA CONTR">COLUMBIA CONTR
                 <option value="COORDINASSETS">COORDINASSETS
                 <option value="DAN HODGES">DAN HODGES
                 <option value="DIRECTOFFICE">DIRECTOFFICE
                 <option value="DMCGRAIN_HM">DMCGRAIN_HM
                 <option value="DULANEY MOTOR">DULANEY MOTOR
                 <option value="DWILMERDING_HM">DWILMERDING_HM
                 <option value="EBECKER_HOME">EBECKER_HOME
                 <option value="FOCUS">FOCUS
                 <option value="FOGLES">FOGLES
                 <option value="GAMES WORKSHOP">GAMES WORKSHOP
                 <option value="GARTLAND">GARTLAND
                 <option value="GROTECH">GROTECH
                 <option value="HOOKMEUP">HOOKMEUP
                 <option value="HUGHES">HUGHES
                 <option value="HUMAN ADVANTAGE">HUMAN ADVANTAGE
                 <option value="HUNT VALLEY MOR">HUNT VALLEY MOR
                 <option value="J. L. PIE">J. L. PIE
                 <option value="JEFF BARNES">JEFF BARNES
                 <option value="JEFF GREENBERG">JEFF GREENBERG
                 <option value="JONES EQUIPMENT">JONES EQUIPMENT
                 <option value="KT INTERIORS">KT INTERIORS
                 <option value="L&H DISTR">L&H DISTR
                 <option value="MARK KATZ">MARK KATZ
                 <option value="MAVA">MAVA
                 <option value="MIETP">MIETP
                 <option value="MILLER BROS.">MILLER BROS.
                 <option value="MKALIS">MKALIS
                 <option value="NATIONAL FRUIT">NATIONAL FRUIT
                 <option value="NAYLOR ANTIQUES">NAYLOR ANTIQUES
                 <option value="NEA DEVELOPMENT">NEA DEVELOPMENT
                 <option value="NEA SP PROJECTS">NEA SP PROJECTS
                 <option value="NEA-TEMP">NEA-TEMP
                 <option value="NEVIS">NEVIS
                 <option value="NOLAN ASSOC">NOLAN ASSOC
                 <option value="PHOENIX">PHOENIX
                 <option value="PRITTS FUNERAL">PRITTS FUNERAL
                 <option value="QUESTMARK">QUESTMARK
                 <option value="RANDISIFAMILY">RANDISIFAMILY
                 <option value="RECRYSTALLIZE">RECRYSTALLIZE
                 <option value="RECRYSTALLIZE30">RECRYSTALLIZE30
                 <option value="REVELLPECHAR">REVELLPECHAR
                 <option value="RIVER PLANTATIO">RIVER PLANTATIO
                 <option value="RIVIANA">RIVIANA
                 <option value="ROUCHARD LAWNSC">ROUCHARD LAWNSC
                 <option value="S & S AUTO">S & S AUTO
                 <option value="S & S AUTO - J">S & S AUTO - J
                 <option value="S & S REPORTS">S & S REPORTS
                 <option value="S&S SPECIAL PR.">S&S SPECIAL PR.
                 <option value="SETTLEMENT SOLU">SETTLEMENT SOLU
                 <option value="STAR SALES">STAR SALES
                 <option value="STERLING">STERLING
                 <option value="STERLINGADVISOR">STERLINGADVISOR
                 <option value="STERLINGCAPITAL">STERLINGCAPITAL
                 <option value="STERLINGFAMOFF">STERLINGFAMOFF
                 <option value="STERLINGFUNDMGN">STERLINGFUNDMGN
                 <option value="STERLINGREALEST">STERLINGREALEST
                 <option value="STERLINGVENTURE">STERLINGVENTURE
                 <option value="STRAUS">STRAUS
                 <option value="SWALKER_HM">SWALKER_HM
                 <option value="TEVIS OIL">TEVIS OIL
                 <option value="THOMPSON AUTO">THOMPSON AUTO
                 <option value="TPETERS">TPETERS
                 <option value="VALHALLA">VALHALLA
                 <option value="VALHALLAMGMT">VALHALLAMGMT
                 <option value="WAHLGREN">WAHLGREN
                 <option value="WALKER VENTURES">WALKER VENTURES
                 <option value="WINER">WINER
                 <option value="WORKFORCE">WORKFORCE
                 <option value="WYNDEMEIR">WYNDEMEIR
            </select>
            </td>

How can I make it so that I have only ONE of those, instead of one for each report that uses the CompanyID as a parameter, so that I can simplify the update process?

Thanks,

Gian
0
Comment
Question by:gian_the_man
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 26

Expert Comment

by:rdcpro
ID: 10769547
If you make your <select> well formed, you can use an entity reference in an XML document to include the source.  You need a DTD or schema though, which may open a can of worms you'd rather avoid.

XSLT has an include and import mechanism.  These differ mostly by the effect the source code has once it's been imported/included.  This can include pre-made templates in an XSLT, which might help.  The XSLT spec also has a document() method which allows you to parse an external XML document and make the data available for the transform.  

But neither of these approaches seem to solve the core issue you're having, unless you're already using XML and/or XSLT in here somewhere.  Why can't use simply use a server-side include in the generated ASP pages to include the select?

<!-- #include virtual="/includes/companyId_inc.asp" -->

where companyId_inc.asp contains the select you need?

Regards,
Mike Sharp

0
 

Author Comment

by:gian_the_man
ID: 10769716
Hey Mike,

Thanks for the suggestions...
I don't do much coding anymore, so my theoretical knowledge of web developing is far beyong my actual abilities, at least with ASP. I'm more familiar with PHP... so even though I know what I want, I'm not sure how to actually make it happen.
A server-side include sounds like the way to go, should the include file contain the select statement and that's it?

Will placing the <!-- #include virtual="/includes/companyId_inc.asp" --> on the sepecific select statement call that file and pour in the values?

Thanks,

Gian
0
 
LVL 26

Accepted Solution

by:
rdcpro earned 300 total points
ID: 10771185
If you have a dozen ASP pages, and each page needs the same snippet of HTML, then yes, you put the

<!-- #include virtual="/includes/companyId_inc.asp" -->

in each ASP page where you want the snippet of HTML to go, and then place the file that actually contains the snippet (called companyId_inc.asp) someplace where all the ASP pages can find it.  I usually have a directory named "includes" where all these go, unless I need them in different places for some reason.  But it doesn't really matter.

There are two types of server-side includes:

Virtual:
<!-- #include virtual="/includes/companyId_inc.asp" -->

File:
<!-- #include file="c:\inetput\wwwroot\includes\companyId_inc.asp" -->

The Virtual uses IIS to figure out where the file is stored, because you specify a virtual path (URL).  The File syntax uses the actual filesystem location.  Virtual is better, because if you should ever change the physical filesystem location of your site, you don't have to change the paths in the includes.

In any case, companyId_inc.asp is a file that contains the <SELECT> html, and could also contain other server-side includes or ASP code.  SSI (server-side includes) always get exectued BEFORE the ASP code runs.  So it's basically the same thing as creating a single ASP page out of a bunch of snippets, and then executing the whole thing.

Regards,
Mike Sharp
0
 

Author Comment

by:gian_the_man
ID: 10771204
Thanks man, appreciate your help...
I'll try it tomorrow and see how it goes but I don't forsee problems...
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSL - change date format 3 53
XSLT list item selection criteria not working 12 39
Formatting issues in XSL FO 3 50
MS Access XML Export Query Setup Multiple Tag Values 15 43
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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, …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

696 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