Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Monday, March 19, 2012

Dynamically send query to report

hi all,
can we use our own SQL queries to display records in the report?
if report contains the Group field.
Can we do this in Crystal Report 8.5
and SQL server 2000
Thanks in Advance
Regards
Henry JonesYes u can
First of all tell me the Client side application techn... u r using

whether classic VB6 / VS2003

and u r requirement is bit unclear can u illustrate more on it

FaFa|||Make use of SQLQuery feauture

Friday, March 9, 2012

Dynamically CHange Table Name

Hi All...
How to dynamically change the Table name which i have use at design time. if old and new table contains same fields but changing only table name.(Old- at Design Time
New - At Run TIme)

I would prefer not to have to go through the hassle of manually opening up my Crystal Report documents in Visual Studio and setting their new table name each and every time I want to make a change to the table name dynamically.

Hope So....
Thanks in Advance.

Regards
Henry Jones.I think this is difficult to do this
See if you find solution here
http://support.businessobjects.com/

Sunday, February 26, 2012

Dynamic View

Dear All,
Hoping you might be able to help me out with a SQL issue.
Want to have a view that contains a join of two tables:
SELECT dbo.VEC_CASE.*, dbo.VEC_MI.*
FROM dbo.VEC_MI INNER JOIN
dbo.VEC_CASE ON dbo.VEC_MI.ID = dbo.VEC_CASE.ID
Problem is that the ID column exists in both tables (and contains the
same value in both) so it wont work as a view, even though it runs fine
as a query.
We keep on adding columns to the tables, and am sick of having to
remember to redefine the view each time and specify all the columns we
want (real one is much more complex than this one).
Can you suggest a way of creating a dynamic view which returns all the
columns, but only one instance of the ID column?
Have tried -
select column_name + ', '
from information_schema.columns where table_name = 'vec_mi'
and column_name <> 'id'
Which will give me a list of all the columns except ID, but the results
are in the form of a recordset. When I try to use this in the view:
SELECT
dbo.VEC_CASE.*,
(select column_name + ', '
from information_schema.columns where table_name = 'vec_mi'
and column_name <> 'id' )
FROM dbo.VEC_MI INNER JOIN
dbo.VEC_CASE ON dbo.VEC_MI.ID = dbo.VEC_CASE.ID
It complains that the subquery returns more than one value.
Is there a way to convert the contents of a recordset into a single
string?
Also tried to create a Stored Procedure / Function to return the
results of the subquery, but cant get the view to recognise the name of
the stored procedure - thinks it is a column.
Also, this whole approach would mean that the design of the view might
change upon execution and so the view might not allow me to do this in
any event.
All assistance gratefully accepted.
Thanks,
Martinjumpa (martin@.jumpa.co.uk) writes:
> Hoping you might be able to help me out with a SQL issue.
> Want to have a view that contains a join of two tables:
> SELECT dbo.VEC_CASE.*, dbo.VEC_MI.*
> FROM dbo.VEC_MI INNER JOIN
> dbo.VEC_CASE ON dbo.VEC_MI.ID = dbo.VEC_CASE.ID
> Problem is that the ID column exists in both tables (and contains the
> same value in both) so it wont work as a view, even though it runs fine
> as a query.
> We keep on adding columns to the tables, and am sick of having to
> remember to redefine the view each time and specify all the columns we
> want (real one is much more complex than this one).
> Can you suggest a way of creating a dynamic view which returns all the
> columns, but only one instance of the ID column?
Keep on adding the columns *that you need* to the view. SELECT * is
generally frowned upon in production code. Say that in five years from
now, someone is looking at the tables and says "hm, I wonder if that
column foo is really used for something real". Well, if SELECT statements
and views only lists columns that are actually used for something, it
can be quite easy to find out, at least if all access is through stored
procedure. But with the SELECT statement like the above, you need to
dive into the client code.
No big deal? There may be a cost for maintaining the value in foo,
and one may consider a redesign that would be a lot easier if we
got forget about foo. But if it's impossible to tell whether foo is
in use, it will have to stay.
And so the system grows, acquiring a bigger and bigger backpack of
legacy, making the system difficult to maintain and evolve.
So keep on adding the columns that are really needed in the view, and
no others.
And, no, there is no "SELECT * - thatcolmn".
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On 6 Jun 2006 06:37:44 -0700, jumpa wrote:

>Dear All,
>Hoping you might be able to help me out with a SQL issue.
(snip)
>All assistance gratefully accepted.
Hi Martin,
In addiition to Erland's reply - both Querty Analyzer and SQL Server
Management Studio allow you to quickly copy alll column names of a table
to a query window by using drag & drop from the object explorer. After
that, you'll just have to remove the duplicates and the unneeded
columns, add prefixes, and you're done.
Hugo Kornelis, SQL Server MVP|||Thanks for the responses guys. This is the first time i've ever used a
discussion group for help with development, definitely not the last.
Agreed, will just have to continue with the manual route.
Incidentally, have since written a stored procedure which drops and
recreates the view with all columns.
Many thanks,
Martin

Friday, February 24, 2012

Dynamic Suppression

Greetings gurus!

Here is a pretty straightforward issue:

Using CR 8.5, I have a report where I have a Details A and a Details B.

Details A = Contains all of the actual field records
Details B = Just a series of dotted separator lines, basically each field from A has a corresponding light grey dotted line underneath it in B.

Well, this is all well and good, but I also have a page footer which has a dark line the width of the page. So whenever it gets to the bottom of a page, I end up with my dotted separator right above the dark page footer line, which looks messy!

I can stop it from printing on the very last record by just adding to the X-2 for Suppress of the Details B: not OnLastRecord

BUT, this doesn't stop the issue with it printing for the last detail record per page!

I considered adding an arbitrary counter to try to limit/define the number of records per page, which would allow me to increment a counter for tripping the suppression, but I have several fields which are set to 'can grow' and thus Page 1 might fit 5 records but Page 2 might fit 10 depending on the dataset being fed at report run time!

Any suggestion for the gurus are much appreciated!

:-)

Ethereal1hi,

I give u alternative solution, change the display sequence of your detail section.
put detail section b (gray dotted line) first and write supperss (section) condition onfirstRecord, then display ur another section A (data)

try with this

-Yags

Wednesday, February 15, 2012

Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that

Hey,

I changed the database name in the initial cataloge in the web.config conncetion string so that it now connects to other databas that contains same tables as the old one,but now i am getting that error at the update stmt !

thank u in advance

Hiba

Do you have the primary key and/or unique fields defined in the new database table? The Update command only knows how to update if it has access to a unique field...

This could explain why it worked in the first database but not the new one.