Page 1 of 1

"Save a copy" of datasource with alias

Posted: Fri Oct 18, 2019 4:38 pm
by ssteketee
Hi. I am a novice user and am trying to use the "save a copy" feature in the "edit data source" window to make multiple copies of a datasource in a report.

What I would like to be able to do is copy the fields on the original databand to the new databand without having to update all the field names because I have to make several copies of the datasource and updating the fields each time will be really time consuming. I thought I should be able to avoid this by using a datasource alias but when I do this, I get the error that the alias is not registered.

Specifically, I have "datasource1" and have specified an alias of "names". The select query pulls from the names table as names. The names table has two fields, firstname and lastname. If I place those fields in the report, they are placed as datasource1.firstname and datasource1.lastname.

If I copy the datasource, it appends "copy" to the datasource name so now it's name is "datasource1copy." I leave the alias as "names."

How do I set it up so that "names" is always the datasource so when I copy the fields from the first databand to the second/copied databand, I don't have to update all the fields?

To me, it seems like if I can just leave the fields datasource as the alias, i should have no problem.

I hope I am explaining this clearly, any help will be appreciated. Thank you, all!

Re: "Save a copy" of datasource with alias

Posted: Wed Oct 23, 2019 6:59 am
by Lech Kulikowski
Hello,

Sorry for the delay with the response.

Maybe we did not exactly understand your problem. Please send us a step by step guide how to reproduce it.

Thank you.

Re: "Save a copy" of datasource with alias

Posted: Fri Oct 25, 2019 2:36 pm
by ssteketee
Thank you for your reply!

These are the steps:

1. Create report with a datasource called source1 and with the datasource alias as data
2. In SQL statement, select field from source1 called field1
3. Retrieve or create field1
4. Place field1 in databand of source1
5. Field1 is placed as "source1.field1"
6. Copy the datasource
7. The name of the copied datasource is automatically generated as source1Copy
8. Leave source1Copy alias as data
9. Copy the source1 databand as the source1Copy databand
10. The copied databand has field1 as the original, "source1.field1"
11. Now I have to manually change the name of field1 in the source1copy databand from "source1.field1" to "source1Copy.field1"

I think I should be able to place the field with the datasource alias instead of the datasource name so that when I copy the databand I do not have to manually adjust the field names.

For example, instead of placing field1 in the first datasource as source1.field1, I want it to be placed as data.field1 . Then, when I copy the databand, data.field1 should work without renaming field1 manually.

It is not such a big deal to manually change the name of one field in a databand, like this example, but in a report with many fields in the databand, it is cumbersome.

Thank you!

Re: "Save a copy" of datasource with alias

Posted: Mon Oct 28, 2019 11:33 am
by Lech Kulikowski
Hello,

We couldn't reproduce the issue.

Please provide more detailed information about step 9.

Thank you.

Re: "Save a copy" of datasource with alias

Posted: Tue Nov 05, 2019 8:04 pm
by ssteketee
To copy the source databand, I open the SQL statement and click the "make a copy" box. This creates a copy of the databand and it is automatically named as Source1Copy with source1Copy also as the alias.

But when I next copy the original databand, the fields are not update to include "copy." I have to go in and manually update each field on the copied databand. It seems to me that if I can keep the alias the same on the databands I should be able to use the alias as the field names in the databand that then when I copy a databand in to a copied databand, I would not have to update the field names.

Re: "Save a copy" of datasource with alias

Posted: Thu Nov 07, 2019 9:30 pm
by Lech Kulikowski
Hello,

Do you mean DataBand on the page or data source in the dictionary?

Copy of the DataBand on the page do not change any Text expressions, it should be changed manually in any case.

Thank you.