Showing posts with label export. Show all posts
Showing posts with label export. Show all posts

Wednesday, March 28, 2012

Problem in Exporting Crystal Reports

Hi All,
I have been using Crystal Reports 8.5 with VB6.0.
I want to set the Export options through VB code.
But when I call the Export method ,the settings whatever I made is not active,it is displaying the default settings only.
How to resolve this?

Thanks in Advance for all helps!

Regards,
Muthukumar.CThere are plenty of articles in Business Objects knowledge base about how to export reports using various interfaces:
http://support.businessobjects.com/library/kbase/articles/c2010117.asp
http://support.businessobjects.com/communityCS/FilesAndUpdates/autexprt.zip.asp

Be sure to always check the knowledge base before posting to forum. In most cases, you will find the solution much faster than you expect.

Problem in Export to PDF or Excel

My report contains some Korean wording. When I export to PDF, the Korean
word appear as ?. Then I export the report in Excel format, there is no
problem in the Korean wording. But when I try to print it, the default page
orientation is 'Landscape' and there is default left and right margin no
matter how I adjust the report size in reporting services. Can anybody help
me ?You should be able to fix the orientation to landscape by switching the size
of the page (8.5x11 versus 11x8.5).
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:5B32F2DF-371B-4951-85BB-B5F550C64095@.microsoft.com...
> My report contains some Korean wording. When I export to PDF, the Korean
> word appear as ?. Then I export the report in Excel format, there is no
> problem in the Korean wording. But when I try to print it, the default
> page
> orientation is 'Landscape' and there is default left and right margin no
> matter how I adjust the report size in reporting services. Can anybody
> help
> me ?|||But my report be shown in 'Portrait'.
"Jeff A. Stucker" wrote:
> You should be able to fix the orientation to landscape by switching the size
> of the page (8.5x11 versus 11x8.5).
> --
> Cheers,
> '(' Jeff A. Stucker
> \
> Business Intelligence
> www.criadvantage.com
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:5B32F2DF-371B-4951-85BB-B5F550C64095@.microsoft.com...
> > My report contains some Korean wording. When I export to PDF, the Korean
> > word appear as ?. Then I export the report in Excel format, there is no
> > problem in the Korean wording. But when I try to print it, the default
> > page
> > orientation is 'Landscape' and there is default left and right margin no
> > matter how I adjust the report size in reporting services. Can anybody
> > help
> > me ?
>
>|||What is the size of the report (page width, page height)?
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:98F66BD1-48F0-43F1-AA23-32CE727DC2F1@.microsoft.com...
> But my report be shown in 'Portrait'.
> "Jeff A. Stucker" wrote:
>> You should be able to fix the orientation to landscape by switching the
>> size
>> of the page (8.5x11 versus 11x8.5).
>> --
>> Cheers,
>> '(' Jeff A. Stucker
>> \
>> Business Intelligence
>> www.criadvantage.com
>> ---
>> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
>> news:5B32F2DF-371B-4951-85BB-B5F550C64095@.microsoft.com...
>> > My report contains some Korean wording. When I export to PDF, the
>> > Korean
>> > word appear as ?. Then I export the report in Excel format, there is
>> > no
>> > problem in the Korean wording. But when I try to print it, the default
>> > page
>> > orientation is 'Landscape' and there is default left and right margin
>> > no
>> > matter how I adjust the report size in reporting services. Can anybody
>> > help
>> > me ?
>>|||page width = 8.5
page height=11
"Jeff A. Stucker" wrote:
> What is the size of the report (page width, page height)?
> --
> Cheers,
> '(' Jeff A. Stucker
> \
> Business Intelligence
> www.criadvantage.com
> ---
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:98F66BD1-48F0-43F1-AA23-32CE727DC2F1@.microsoft.com...
> > But my report be shown in 'Portrait'.
> >
> > "Jeff A. Stucker" wrote:
> >
> >> You should be able to fix the orientation to landscape by switching the
> >> size
> >> of the page (8.5x11 versus 11x8.5).
> >>
> >> --
> >> Cheers,
> >>
> >> '(' Jeff A. Stucker
> >> \
> >>
> >> Business Intelligence
> >> www.criadvantage.com
> >> ---
> >> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> >> news:5B32F2DF-371B-4951-85BB-B5F550C64095@.microsoft.com...
> >> > My report contains some Korean wording. When I export to PDF, the
> >> > Korean
> >> > word appear as ?. Then I export the report in Excel format, there is
> >> > no
> >> > problem in the Korean wording. But when I try to print it, the default
> >> > page
> >> > orientation is 'Landscape' and there is default left and right margin
> >> > no
> >> > matter how I adjust the report size in reporting services. Can anybody
> >> > help
> >> > me ?
> >>
> >>
> >>
>
>|||Can anyone help me ?
My question is :
My report contains some Korean wording. When I export to PDF, the Korean
word appear as ?. Then I export the report in Excel format, there is no
problem in the Korean wording. But when I try to print it, the default page
orientation is 'Landscape' and there is default left and right margin no
matter how I adjust the report size in reporting services.
"May Liu" wrote:
> page width = 8.5
> page height=11
> "Jeff A. Stucker" wrote:
> > What is the size of the report (page width, page height)?
> >
> > --
> > Cheers,
> >
> > '(' Jeff A. Stucker
> > \
> >
> > Business Intelligence
> > www.criadvantage.com
> > ---
> > "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > news:98F66BD1-48F0-43F1-AA23-32CE727DC2F1@.microsoft.com...
> > > But my report be shown in 'Portrait'.
> > >
> > > "Jeff A. Stucker" wrote:
> > >
> > >> You should be able to fix the orientation to landscape by switching the
> > >> size
> > >> of the page (8.5x11 versus 11x8.5).
> > >>
> > >> --
> > >> Cheers,
> > >>
> > >> '(' Jeff A. Stucker
> > >> \
> > >>
> > >> Business Intelligence
> > >> www.criadvantage.com
> > >> ---
> > >> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> > >> news:5B32F2DF-371B-4951-85BB-B5F550C64095@.microsoft.com...
> > >> > My report contains some Korean wording. When I export to PDF, the
> > >> > Korean
> > >> > word appear as ?. Then I export the report in Excel format, there is
> > >> > no
> > >> > problem in the Korean wording. But when I try to print it, the default
> > >> > page
> > >> > orientation is 'Landscape' and there is default left and right margin
> > >> > no
> > >> > matter how I adjust the report size in reporting services. Can anybody
> > >> > help
> > >> > me ?
> > >>
> > >>
> > >>
> >
> >
> >

problem in export of csv file into sql server

I am trying to export a CSV file into sql server. I wrote a query to perform select fields from csv file using OPENROWSET. I am getting all the values in a single column, but I need to get in three different columns. Any can body can help me



The query is as follows

Select * from OpenRowset ('MSDASQL','Driver= {Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=” Directory name” \;Extended properties=''ColNameHeader=True; Format=Delimited;''','select * from Sample.csv')



Sample.csv

col1, col2, col3 ---- all the values are in single cell of excel csv file
1, a, abc
2, sfasf, sdgagas



Output of query is

col1,col2,col3 --- all the values are coming in one column and with comma between them
1,a,abc
2,sfasf,sdgagas

can any body help me where i am going wrong?

Thanks in advance
suryamight be easier to just import the entire file to a staging table and the work with it from there.|||would u like to give me some sample code|||Doh - something wrong with my pc, please ignore 2 duplicate answers and refer the top one.|||Have you used DTS in this case to import the rows which is an easier solution or what is requirement to use OPENROWSET statement.|||Have you used DTS in this case to import the rows which is an easier solution or what is requirement to use OPENROWSET statement.
See this http://www.sql-server-helper.com/tips/read-import-excel-file-p01.aspx fyi.

Friday, March 23, 2012

Problem in a CROSS to SQL

Dear friends;

I have a CROSS table in ACCESS that I want to export to SQL 2005. The query is:

TRANSFORM Count(GD_PROFILE.cnRow) AS CountOfcnRow

SELECT GD_PROFILE.ID

FROM GD_PROFILE

GROUP BY GD_PROFILE.ID

PIVOT GD_PROFILE.ID_APLIC;

The RESULT is:

ID

20

22

77

122

141

179

211

327

334

370

388

405

524

584

645

687

826

865

914

CN1

1

1

1

1

1

CN2

1

1

1

1

CN3

1

1

1

1

CN4

1

1

1

1

1

CN5

1

1

1

1

CN8

1

1

1

1

1

1

1

1

1

1

1

CN14

1

1

1

1

1

1

1

1

CN15

1

1

1

1

1

1

1

1

1

1

CN22

1

1

1

1

1

1

1

1

CN29

1

1

1

1

1

1

1

CN36

1

1

1

I want to create a query in SQL Server that give me rows from the cross query that are equal. For example, the row 1 and 4 are equal. Has the same values in each row. How can I make it programatically?

The Cross is a simple cross query, and the goal is return this final result:

Profile 1 - ID CN1, ID CN4

Profile 2 - ID CN2, ID CN3, ID CN5

Profile 3 - ID CN8

Profile 4 - ID CN14

Profile 5 - ID CN15

Profile 6 - ID CN22

Profile 7 - ID CN29

Profile 8 - ID CN36

Could you HELP me?
THANKS!!!!

HELP me please!!!!

I need it soon!!

Thanks!!!!!!!

|||

--For SQL Server 2005:

SELECT ROW_Number() OVER(ORDER BY (pvt.[1] + coalesce(', ' + pvt.[2], '') + coalesce(', ' + pvt.[3], ''))) AS Profile,

pvt.[1] + coalesce(', ' + pvt.[2], '') + coalesce(', ' + pvt.[3], '') as merged

FROM(SELECT ID, ROW_Number() OVER (PARTITION BY coalesce (',' + [F2] , '-') + + coalesce(',' + [F3], '-') + coalesce(',' + [F4], '-' ) + coalesce(',' + [F5], '-') + coalesce(',' + [F6], '-' ) + + coalesce (',' + [F7] , '-') + coalesce(',' + [F8], '-') +coalesce(',' + [F9], '-') + coalesce(',' + [F10], '-' ) + + coalesce (',' + [F11] , '-') + coalesce(',' + [F12], '-') + coalesce(',' + [F13], '-') + coalesce(',' + [F14], '-' ) + + coalesce (',' + [F15] , '-') + coalesce(',' + [F16], '-') +coalesce(',' + [F17], '-') + coalesce(',' + [F18], '-') + + coalesce( ',' + [F19], '-') + coalesce (',' + [F20] , '-') ORDER BY ID) AS rowNum_ID,

coalesce(',' + [F2], '-') + + coalesce( ',' + [F3], '-') + coalesce (',' + [F4] , '-') + coalesce(',' + [F5], '-') + coalesce(',' + [F6], '-' ) + + coalesce (',' + [F7] , '-') + coalesce(',' + [F8], '-') + coalesce(',' + [F9], '-') + coalesce(',' + [F10], '-' ) + + coalesce (',' + [F11] , '-') + coalesce(',' + [F12], '-') + coalesce(',' + [F13], '-') + coalesce(',' + [F14], '-' ) + + coalesce (',' + [F15] , '-') + coalesce(',' + [F16], '-') + coalesce(',' + [F17], '-') + coalesce(',' + [F18], '-') + + coalesce( ',' + [F19], '-') + coalesce (',' + [F20] , '-') AS newlabel

FROM yourTable) as t1

pivot (min(ID) for rowNum_ID in ([1], [2], [3]))AS pvt

ORDER BY pvt.[1] + coalesce(', ' + pvt.[2], '') + coalesce(', ' + pvt.[3], '')

CREATE TABLE yourTable(

[ID] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F2] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F3] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F4] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F5] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F6] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F7] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F8] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F9] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F10] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F11] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F12] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F13] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F14] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F15] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F16] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F17] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F18] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F19] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[F20] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN1',NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1','1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN2',NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN3',NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN4',NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,'1','1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN5',NULL,'1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,NULL,'1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN8','1','1',NULL,'1','1',NULL,NULL,NULL,NULL,'1','1',NULL,NULL,'1','1','1','1','1',NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN14','1','1',NULL,'1','1',NULL,NULL,NULL,NULL,'1','1',NULL,NULL,'1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN15','1','1','1','1','1',NULL,'1',NULL,NULL,'1','1',NULL,NULL,'1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN22',NULL,'1',NULL,NULL,NULL,'1',NULL,NULL,'1','1',NULL,'1','1','1',NULL,NULL,'1',NULL,NULL)

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN29','1','1',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,'1',NULL,'1',NULL,NULL,'1',NULL,'1')

INSERT INTO [yourTable] ([ID],[F2],[F3],[F4],[F5],[F6],[F7],[F8],[F9],[F10],[F11],[F12],[F13],[F14],[F15],[F16],[F17],[F18],[F19],[F20])VALUES('CN36',NULL,NULL,NULL,'1',NULL,NULL,NULL,'1',NULL,NULL,NULL,NULL,NULL,'1',NULL,NULL,NULL,NULL,NULL)

|||

Dear Friend!

First of all I want to thank your help.

The Grid above is a result of a CROSS query based in this table:

ID

ID_APLIC

CN1

826

CN1

584

CN1

524

CN1

370

CN1

22

CN2

826

CN2

584

CN2

370

CN2

22

CN3

826

CN3

584

CN3

370

CN3

22

CN4

826

CN4

584

CN4

524

CN4

370

CN4

22

CN5

826

CN5

584

CN5

370

CN5

22

CN8

865

CN8

826

CN8

687

CN8

645

CN8

584

CN8

388

CN8

370

CN8

141

CN8

122

CN8

22

CN8

20

CN14

826

CN14

584

CN14

388

CN14

370

CN14

141

CN14

122

CN14

22

CN14

20

CN15

826

CN15

584

CN15

388

CN15

370

CN15

211

CN15

141

CN15

122

CN15

77

CN15

22

CN15

20

CN22

826

CN22

584

CN22

524

CN22

405

CN22

370

CN22

334

CN22

179

CN22

22

CN29

914

CN29

826

CN29

584

CN29

405

CN29

370

CN29

22

CN29

20

CN36

584

CN36

327

CN36

122

What I want is to check the CN (Computernames) that have the same profile. Example, I know that CN1 and CN4 has the same aplications, the profile one.

For each CN I need to know if the profile for this CN already exists, if true insert the reference in Computername Table, and if false, create new Profile in table Profile and the aplicationIDs in Profile_AplicID Table.

Profile

ID_Profile

Nome

1

Profile 1

2

Profile 2

3

Profile 3

4

Profile 4

Profile_AplicID

AplicID_Profile

ID_Profile

22

1

370

1

524

1

584

1

826

1

Computername

CN_ID

ID_Profile

CN1

1

CN4

1

COULD YOU HELP ME?!!
THANKS FRIEND!!!

|||

Anyone need more help to understand my problem?
Thanks!!!

|||Anyonne there?