cancel
Showing results for 
Search instead for 
Did you mean: 

failed to retrive data from database

LukaszBloch
Participant
0 Kudos

Hi.

I have a layut in Crystal.

This report uses 2 views. PrintOinvHeader and PrintInv1Lines

when i use fields from first view everything is ok.

When i add line form view 2'nd to the report i have this error and next one

Canot detremine the queries necessary to get data from this report

Accepted Solutions (0)

Answers (2)

Answers (2)

LukaszBloch
Participant
0 Kudos

Hi.

what do you mean by "join the 2 views on docentry in CR."

In first option there was no entry in views "(t0.DocEntry = 4500)

and docentry was a parametr.

I also have this two views linked by docentry

What else i can do in CR?

Former Member
0 Kudos

Lukasz,

i merged your 2 views, look a bit back and there is this non parameter fixed docentry....

And by that i mean that add the 2 views to CR as datasources,

then link them on from head to items on docentry field.

Regards,

D

Former Member
0 Kudos

it means that for CR your 2 views are not SQL steady, or your linking is not right.

Try this:

Create a command as a datasource with something like:

Select * from PrintOinvHeader t0 inner join PrintInv1Lines t1 on "herecomes your join".

I (and probably we) can't help you any more, without knowing the exact 2 queries behind your views.

LukaszBloch
Participant
0 Kudos

Hi. there are those scripts

USE [BAZA2]

GO

/****** Object: View [dbo].[PrintInv1Lines] Script Date: 04/05/2011 14:50:44 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE VIEW [dbo].[PrintInv1Lines]

AS

SELECT t0.DocEntry, t0.ItemCode, t0.Dscription, t0.Price, t0.PriceBefDi, t0.PriceAfVAT, t0.DiscPrcnt, t0.LineTotal, t0.LineVat, t0.Currency, t0.VatSumFrgn, t0.LineVatlF,

t0.VatGroup, t0.VatPrcnt, t0.unitMsr

FROM dbo.INV1 AS t0 INNER JOIN

dbo.OITM AS t1 ON t1.ItemCode = t0.ItemCode

WHERE (t0.DocEntry = 4500)

USE [BAZA2]

GO

/****** Object: View [dbo].[PrintOinvHeader] Script Date: 04/05/2011 14:50:35 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE VIEW [dbo].[PrintOinvHeader]

AS

SELECT t0.DocEntry, t0.DocNum, t0.DocDate, t0.TaxDate, t0.DocDueDate, t1.CardCode, t1.CardName, t2.PymntGroup, t0.ObjType, t0.Address, t1.LicTradNum

FROM dbo.OINV AS t0 INNER JOIN

dbo.OCRD AS t1 ON t1.CardCode = t0.CardCode INNER JOIN

dbo.OCTG AS t2 ON t2.GroupNum = t0.GroupNum

WHERE (t0.DocEntry = 4500)

Former Member
0 Kudos

Lukasz,

why don't you use 1 view instead?

0USE BAZA2

GO

/****** Object: View dbo.PrintInv1Lines Script Date: 04/05/2011 14:50:44 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE VIEW dbo.PrintInv1Lines

AS

SELECT t0.DocEntry, t0.ItemCode, t0.Dscription, t0.Price, t0.PriceBefDi, t0.PriceAfVAT, t0.DiscPrcnt, t0.LineTotal, t0.LineVat, t0.Currency, t0.VatSumFrgn, t0.LineVatlF,

t0.VatGroup, t0.VatPrcnt, t0.unitMsr


,
 t2.DocEntry, t2.DocNum, t2.DocDate, t2.TaxDate, t2.DocDueDate, t2.CardCode, t2.CardName, t4.PymntGroup, t2.ObjType, t2.Address, t3.LicTradNum

FROM dbo.INV1 AS t0 INNER JOIN

inner join dbo.oinv as t2 on t0.docentry=t2.docentry
inner join
dbo.OCRD AS t3 ON t2.CardCode = t3.CardCode INNER JOIN
dbo.OCTG AS t4 ON t2.GroupNum = t4.GroupNum

dbo.OITM AS t1 ON t1.ItemCode = t0.ItemCode

WHERE (t0.DocEntry = 4500)

or

join the 2 views on docentry in CR.