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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic hyperlink (Crystal Report RAS).. ? can u solve?

Status
Not open for further replies.

wolfieman

Programmer
Oct 17, 2002
10
0
0
DK
We have an almost empty report, and are using ASP to create this
report at runtime. The report looks like this:

-------------------
(report header)
-------------------

(Pageheader)
-------------------
(detail)
Dynamic database fields example........
*Company* *Address* *postal* *city*
-------------------
(Pagefooter)
-------------------
(report footer)
-------------------

The user chooses the fields they want to see on the report from a ASP webpage. In this example they want to see company, address, portal, city.

What we would like to do now, is to create a http link for example
for the company. This link should be dynamic and not a static http
link. This mean that the parameter should change for each row.
We have an almost empty report, and are using ASP to create this
report at runtime. The report looks like this:

-------------------
(report header)
-------------------

(Pageheader)
-------------------
(detail)
Dynamic database fields example........
*Company* *Address* *postal* *city*
-------------------
(Pagefooter)
-------------------
(report footer)
-------------------

The user chooses the fields they want to see on the report from a ASP webpage. In this example they want to see company, address, portal, city.

What we would like to do now, is to create a http link for example
for the company. This link should be dynamic and not a static http
link. This mean that the parameter should change for each row.
For instance (the above example):

Company Microsoft Microsoft Road 8000 San Francisco
Company Dell Dellroad 29 8100 Los Angeles
Company Carlsberg Milkroad 9 8200 Beertown

When i click on the company field i would like to send 2 parameter
to the http page. For instance it would redirect me to:

for Company Microsoft:
Microsoft&postal=8000

for Company Dell:
Dell&postal=8100

----------------------------------------
For each field i put on the form dynamically, i do the following:

Set NewReportObject = ObjectFactory.CreateObject("CrystalReports.FieldObject")
With NewReportObject

.Kind = FieldToAdd.Kind
.FieldValueType = FieldToAdd.Type
.DataSource = FieldToAdd.FormulaForm
.Left = left_start
.width = field_size
.format.EnableCanGrow = true
End With

Set SectionToAddTo = session("egbolig_oClientDoc").ReportDefinition.DetailArea.Sections.Item(0)
session("egbolig_oClientDoc").ReportDefController.ReportObjectController.Add NewReportObject, SectionToAddTo

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

What i have tried to do to insert the dynamic http link is this:

NewReportObject.Format.HyperlinkType = crHyperlinkTypeWebsite
NewReportObject.Format.HyperlinkText = "
This will NOT work. this will not insert the correct company name with {company.name}. It will be static so it will redirect me to:



I have also tried to make a conditional formula field with the
following 2 lines:

With NewReportObject.Format.ConditionFormulas.Formula(crObjectFormatConditionFormulaTypeHyperlink)
.Syntax = crFormulaSyntaxBasic
.Text = "{company.name}"
End With

This does not work either. See ERROR MSG 1 AND 2 ....
Cause .Text would returns boolean!....

How do we solve this problem?? What is the right appoach to this..
Is it a bug or something missing in the API?...
If you could provide me with a code example..????

Please write as soon as possible!
 
This may not be your ASP. It may be the hyperlink structure. Hyperlinks behave very tetchily in CR.

Some points to consider:

The postal passing to the URL may need to be converted to text before it's passed.

You'll need to insert connection details in the link. It may be that you have already done this, and just omitted it for the post.

Additionally, confirm whether or not this is for managed or unmanaged reporting. If you've installed any patches, ascertain which ones.

Certain CE hot-fix patches, whilst fixing what you installed them for, have an unfortunate side-effect of completely disabling the dynamic functionality of hyperlinks, causing a loop of the original static values to be passed over and over again.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top