Crystal Report отчет и программа на VB6

Работа VB и СУБД (Access, MSSQL, MySQL, Oracle и пр.)
Правила форума
При создании новой темы не забывайте указывать используемую СУБД.
Ol1965
Обычный пользователь
Обычный пользователь
 
Сообщения: 57
Зарегистрирован: 21.02.2005 (Пн) 9:29

Crystal Report отчет и программа на VB6

Сообщение Ol1965 » 03.01.2006 (Вт) 15:07

Доброго времени суток. Всех с наступившим Новым годом! Большая просьба! Кто сталкивался. Отчет создан с помощью Crystal Report 10, как его обновить и вызвать на печать из программы на VB6. Заранее спасибо.

alibek
Большой Человек
Большой Человек
 
Сообщения: 14205
Зарегистрирован: 19.04.2002 (Пт) 11:40
Откуда: Russia

Сообщение alibek » 09.01.2006 (Пн) 17:06

В смысле, сохраненный в файл отчет?
Наверное только с помощью инструментов Crystal Report.
Lasciate ogni speranza, voi ch'entrate.

Ol1965
Обычный пользователь
Обычный пользователь
 
Сообщения: 57
Зарегистрирован: 21.02.2005 (Пн) 9:29

Crystal Report 10 и VB6

Сообщение Ol1965 » 11.01.2006 (Ср) 15:47

Спасибо за отклик. .RPT - файл уже создан и находится в папке с приложением на VB6. Необходимо: обновить этот файл (т.е. обработать новые и измененные записи из БД на Access) и выдать в программе окно "Вывод на печать" или подобное, дающее возможность распечатать Отчет (желательно с предварительным просмотром). Заранее - СПАСИБО.

Konst_One
Член-корреспондент академии VBStreets
Член-корреспондент академии VBStreets
Аватара пользователя
 
Сообщения: 3041
Зарегистрирован: 09.04.2004 (Пт) 13:47
Откуда: Химки

Сообщение Konst_One » 11.01.2006 (Ср) 15:54

The application you created is using one of the following methods to access the Crystal Reports Engine. Click the appropriate method from the following list to determine the files you are required to include.

METHOD PROJECT REFERENCE NAME DESCRIPTION
Report Designer Component (craxdrt.dll) Crystal Report 8 ActiveX Designer Runtime library 32-bit only COM object model, dual interface, apartment model
Crystal Reports Automation Server (cpeaut32.dll) Crystal Report Print Engine 8 Object Library 32-bit COM object model, dispatch only
Crystal Report Engine API (crpe32.dll) Crystal Report API Interface, declares encapsulated in either global32.bas or crpe.h Interface for C developers
Crystal ActiveX Control (crystl32.ocx) ActiveX Control 32-bit OCX

Konst_One
Член-корреспондент академии VBStreets
Член-корреспондент академии VBStreets
Аватара пользователя
 
Сообщения: 3041
Зарегистрирован: 09.04.2004 (Пт) 13:47
Откуда: Химки

Сообщение Konst_One » 11.01.2006 (Ср) 15:58

В догонку , как работать с сохраненными отчетами: :!:

In this example, you will open an existing report file in Visual Basic. This will demonstrate how to import existing reports (*.RPT files) and allow you to become familiar with the Report Designer Component user interface. This tutorial uses Seagate Crystal Reports 7 and Microsoft Visual Basic 6.0.
Ensure that you have completed installation of the Report Designer Component files and make note of the installation directory if you did not accept the default selection.
Open a Report directly within Visual Basic 5.0 or 6.0

1 Open Visual Basic and create a new Standard EXE project by selecting Standard EXE from the start up dialog or selecting it from New Project under the File menu.

2 Add the Report Designer Component to Visual Basic if not already added during the installation process.
3 From the Project menu, select Components…
4 Click the Designers tab and check Crystal Reports 8. Click Apply and then click Close. The Report Designer is now available in this project and any projects you create in the future.
5 Now we need to insert the Report Designer into the project form. On the Project menu, point to More ActiveX Designers and then click Add Crystal Reports 8.

6 The Seagate Crystal Report Gallery appears displaying the different types of Report Experts that are available. Since you will be opening an existing report file, click From an Existing Report. Click OK.
7 Browse to the report called World Sales Report at \Crystal Reports\Sample\Reports\General Business\. Click Open. Depending on your setup, you may be presented with a dialog that asks you about adding a form at runtime. Click OK for now.
8 The Report Designer Component is added to your project and, in a few seconds, the report layout is displayed in the design window. Report files created in any version of Seagate Crystal Reports can be imported in this manner. Before you run the report, right-click on Form2, and select View Code. You should see Visual Basic code that looks like this:

Dim Report As New CrystalReport1

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub

This default code, inserted by the Report Designer Component, will point the runtime Crystal Report Viewer at the report to display the results. This makes it easy to flip between the report design window and the finished report. You can add to or modify this code, but for now we'll just view the report.

9 From the Run menu select Start (F5) or click on the Start button on the Visual Basic toolbar. After a few seconds, you will see a form displaying the finished report in the Crystal Report Viewer. You can resize the form by dragging the lower right hand corner of the Viewer. You can save this project if you like, but it will not be required to complete the steps in the next section.

Now that you have opened and viewed a report, feel free to go back and explore some of the right-click and property settings in the Report Designer window. You may also want to browse the CRViewer class of the CRVIEWERLibCtl object to see some of the properties and methods that you can use to customize the appearance of the viewer at runtime.

Ol1965
Обычный пользователь
Обычный пользователь
 
Сообщения: 57
Зарегистрирован: 21.02.2005 (Пн) 9:29

Сообщение Ol1965 » 16.01.2006 (Пн) 17:30

Вопрос с моей стороны может показаться глупым. А где ссылка на созданный .RPT файл?

Konst_One
Член-корреспондент академии VBStreets
Член-корреспондент академии VBStreets
Аватара пользователя
 
Сообщения: 3041
Зарегистрирован: 09.04.2004 (Пт) 13:47
Откуда: Химки

Сообщение Konst_One » 16.01.2006 (Пн) 17:42

7 Browse to the report called World Sales Report at \Crystal Reports\Sample\Reports\General Business\
там все и лежит


Вернуться в Базы данных

Кто сейчас на конференции

Сейчас этот форум просматривают: Google-бот и гости: 1

    TopList