Dream Report: Acquiring Data using SQL Statements

ESECOTV
21 Feb 202413:52

Summary

TLDRThis tutorial showcases how to integrate Dream Report with SQL Server to visualize data. It demonstrates two methods for pulling data: one using a permanent SQL statement within Dream Report and another by typing SQL statements directly. The video guides viewers through creating a DSN for database connection, setting up SQL queries, and generating reports. It also highlights the importance of sorting within SQL statements and the impact on licensing when using the SQL option in Dream Report.

Takeaways

  • 😀 Dream Report is a tool for visualizing data from multiple sources.
  • 🔧 Two methods for getting data into Dream Report are discussed: typing SQL statements directly and creating a permanent SQL statement.
  • 💾 The script demonstrates setting up a DSN (Data Source Name) within Dream Report, avoiding the need to configure it in Windows.
  • 🗂️ The process of creating a DSN involves specifying a DSN definition name, selecting a system data source, and setting up server and authentication details.
  • 🔗 The importance of testing the DSN connection within Dream Report to ensure successful setup is highlighted.
  • 📊 SQL Manager in Dream Report is used to define and store SQL queries for reuse in reports.
  • 📝 The script shows how to create and use predefined SQL queries within Dream Report for sorting data in ascending or descending order.
  • 🖥️ The video explains how to use a visual query builder in Dream Report for creating SQL statements without prior SQL knowledge.
  • 📈 Dream Report's capability to connect to relational databases and pull data based on complex queries is demonstrated.
  • 💼 The licensing model for Dream Report is mentioned, with a note on the 'mees' option for unlimited SQL queries.

Q & A

  • What is Dream Report and what does it do?

    -Dream Report is a reporting tool that allows users to visualize data from multiple sources. It is designed to help users create and manage reports efficiently.

  • How many ways are discussed in the script to get data into Dream Report?

    -Two ways are discussed in the script to get data into Dream Report: typing SQL statements for each instance and creating a permanent SQL statement that can be reused.

  • What is a DSN and why is it used in Dream Report?

    -A DSN (Data Source Name) is used in Dream Report to create a configuration that allows the software to connect to a database without having to configure it within Windows. It simplifies the connection process.

  • Why is the timestamp important in the SQL Server example provided in the script?

    -The timestamp is important because it is used to determine the data retrieval based on the first record within the table, using the day timestamp to make that determination.

  • What is the purpose of DSN Manager in Dream Report?

    -DSN Manager in Dream Report is used to create the DSN configuration from within the software, which simplifies the process of setting up a connection to a database.

  • How does one create a DSN in Dream Report as per the script?

    -To create a DSN in Dream Report, one would go into DSN Manager, give a DSN definition name, add a DSN by selecting a system data source, provide a name, choose the server, select SQL Server authentication, specify the database, and then test the connection.

  • What is the difference between defining a SQL statement for each instance versus creating a permanent SQL statement in Dream Report?

    -Defining a SQL statement for each instance is more manual and requires retyping the statement each time, while creating a permanent SQL statement allows for reusability and easier management of the SQL queries within Dream Report.

  • How does one define a permanent SQL statement in Dream Report?

    -To define a permanent SQL statement in Dream Report, one would use the SQL Manager, give the statement a name, and type the entire SQL statement as required for the database query.

  • What is the advantage of using a predefined SQL query in Dream Report?

    -Using a predefined SQL query in Dream Report allows for the reuse of the same query without having to redefine it each time, which saves time and reduces the potential for errors.

  • How does the script suggest handling complex queries in Dream Report?

    -The script suggests using the visual query builder in Dream Report for complex queries, which allows users to visually select the table and fields they want to include in their query.

  • What licensing consideration is mentioned in the script for using SQL statements in Dream Report?

    -The script mentions that using SQL statements in Dream Report may affect the licensing model, particularly the tag count. For unlimited SQL queries, the 'mees' option should be included in the license.

Outlines

00:00

📊 Introduction to Dream Report and SQL Integration

The video script introduces Dream Report, a reporting tool for visualizing data from multiple sources. It outlines two methods for integrating SQL statements within Dream Report. The first method involves manually typing SQL statements each time data is pulled, while the second method creates a permanent SQL statement that can be reused. The video emphasizes not defining an ODBC driver but instead creating a DSN (Data Source Name) for data source configuration within Dream Report. The presenter demonstrates setting up a DSN using DSN Manager, selecting a system data source, specifying server details, and using SQL Server authentication to connect to a database containing a table with product and quantity information. The timestamp is crucial for determining the data retrieval based on the first record in the table.

05:02

🔍 Creating Reusable SQL Queries in Dream Report

The script details the process of creating a permanent SQL statement within Dream Report for reuse. This is done through SQL Manager, where the presenter defines a query to sort data by quantity in ascending order. Another query is created to sort the same data in descending order. The advantage of this method is that it allows for more powerful and flexible data retrieval, though it requires more knowledge of SQL. The presenter then shows how to use these predefined queries in a report by selecting the DSN and choosing the appropriate query. The sorting within Dream Report is disabled to let the SQL statement handle the sorting. The video concludes with a demonstration of running the report and viewing the results in ascending and descending order.

10:02

🛠 Advanced SQL Query Building in Dream Report

The final paragraph discusses an advanced method of building SQL queries directly within Dream Report using a visual query builder. This approach allows users to select tables and fields, define sorting orders, and even add filters without manually typing SQL statements. The presenter demonstrates creating a query to retrieve data in descending order using the visual builder. The script also touches on the potential complexity of queries and the flexibility of Dream Report in handling them. It mentions the ability to filter data based on specific conditions and the impact of SQL query generation on the licensing model of Dream Report. The video ends with a call to action for viewers to provide feedback and contact local representatives for more information on Dream Report.

Mindmap

Keywords

💡Dream Report

Dream Report is a reporting tool mentioned in the script, which allows users to visualize data from multiple sources. It is the central focus of the video, as the script describes how to use this tool to create reports. The video aims to help viewers get started with Dream Report quickly, showcasing its capabilities and features.

💡SQL Statements

SQL (Structured Query Language) statements are used in the video to extract data from a database. The script explains two methods of using SQL with Dream Report: typing SQL statements for each instance or creating a permanent SQL statement that can be reused. This is crucial for data retrieval and manipulation within the reporting tool.

💡DSN (Data Source Name)

A DSN is a configuration that defines the connection parameters to a database. In the context of the video, the script describes how to create a DSN using Dream Report's DSN manager, which simplifies the process of connecting to a SQL Server without having to configure it within Windows. The DSN is named 'SQL 2019' in the example, and it's used to establish a connection for data retrieval.

💡ODBC Driver

An ODBC (Open Database Connectivity) driver is a software component that allows applications to connect to and interact with databases. The script notes that for the method being demonstrated, the creation of an ODBC driver from within Dream Report is not required, which streamlines the process of setting up data connections.

💡SQL Server

SQL Server is a relational database management system developed by Microsoft. The video script includes an example where the presenter shows a SQL Server with a table containing product information and timestamps. This server is used to demonstrate how to pull data into Dream Report for reporting purposes.

💡Timestamp

A timestamp in the context of the video refers to a data element that records the date and time when a record was created or modified. The script mentions using the timestamp to determine the data to be retrieved from the SQL Server, specifically to select the data based on the first record within the table.

💡SQL Manager

SQL Manager within Dream Report is a feature that allows users to define and store SQL statements for reuse. The script demonstrates how to create and save SQL queries within Dream Report, which can then be selected and used in reports. This feature enhances efficiency by avoiding the need to repeatedly write the same SQL queries.

💡Report

A report in the video refers to the output generated by Dream Report, which compiles and presents data in a structured format. The script guides viewers through the process of creating a new report, selecting data sources, and applying SQL queries to display the data in either ascending or descending order based on specified criteria.

💡Visual Query Builder

The Visual Query Builder is a tool within Dream Report that allows users to graphically construct SQL queries without manually writing the SQL code. The script describes using this builder to select tables, fields, and sort orders, making it easier for users to create complex queries through a more intuitive interface.

💡Tag Count

Tag count in the context of Dream Report refers to the number of elements or components used in a report, which can affect licensing costs. The script mentions that using SQL statements, as shown in the video, requires the 'Mees' option in the licensing model to allow for unlimited SQL queries, whereas other methods might consume tag count and thus be more costly.

Highlights

Introduction to Dream Report as a data visualization tool.

Explanation of two methods for getting data into Dream Report using SQL statements.

Demonstration of creating a permanent SQL statement within Dream Report for data retrieval.

Clarification on not defining an ODBC driver and instead creating a DSN for data source configuration.

Step-by-step guide on creating a DSN using DSN Manager in Dream Report.

Selection of a system data source and specifying server details for the DSN.

Authentication method choice between SQL Server and Windows authentication for the DSN.

Testing the DSN connection to ensure successful setup.

Creating a new report in Dream Report and setting up the initial configuration.

Using SQL Manager to define and reuse SQL statements for reports.

Creating two SQL statements for sorting data in ascending and descending order.

Adding a SQL query table to the report and selecting a predefined query.

Disabling automatic sorting in Dream Report to let the SQL statement handle it.

Running the report to view data sorted by the predefined SQL queries.

Introduction to the visual query builder for creating SQL statements within Dream Report.

Building a SQL statement using the visual query builder for data sorting.

Discussing the power and flexibility of creating SQL statements directly in Dream Report.

Mention of the licensing model and its impact on using SQL statements in Dream Report.

Conclusion on the capabilities of Dream Report in communicating with databases.

Transcripts

play00:00

[Music]

play00:08

dream report is a reporting tool that

play00:10

allows you to visualize data from

play00:13

multiple sources these videos are

play00:15

designed to help you get up and running

play00:17

with dream report in no time so let's

play00:20

Jump Right In what I'm want to show is a

play00:23

way of getting data into dream report

play00:25

but it will actually require you to

play00:27

create SQL statements now there's two

play00:30

ways of doing this one is where we

play00:32

actually type the SQL statement in for

play00:35

each instance that we want to pull data

play00:37

in and another way is we used or we will

play00:40

create a SQL statement that is a

play00:44

permanent SQL statement almost like an

play00:47

object that you can then refer to uh to

play00:50

pull the data out and this will be a

play00:51

little bit clearer once you see me go

play00:53

through it with this way we're going to

play00:55

be doing it today you will notice one

play00:56

thing different is we will not Define an

play00:58

obbc driver

play01:00

we will create a DSN uh data source we

play01:04

will go through that process but we will

play01:06

actually not create an NBC driver out of

play01:10

dream report to be able to do this so

play01:12

with that being said let's jump right

play01:14

into it first off uh here's my SQL

play01:16

Server I want to show you this I've got

play01:19

a table I got two records in that table

play01:21

like a production table of how of a

play01:24

product we're going to make and the

play01:26

quantity we're going to make and I've

play01:27

got a time stamp around that so I'm

play01:30

going show how all that comes in to

play01:32

triam report uh the time stamp is going

play01:34

to be important because when we do this

play01:36

query we getting this data from SQL

play01:38

Server we're going to have to uh or the

play01:42

way I'm going to set it up is to specify

play01:44

that I want the data based off the first

play01:48

record within the table and it's going

play01:50

to be using the day time stamp to make

play01:52

that determination over on dream report

play01:55

what we're going to start off by doing

play01:57

is creating going into DSN manager and

play02:01

what DSN manager does it's an easy way

play02:03

for us to create the DSN configuration

play02:07

from within dream report and not have to

play02:09

go into windows and create it by the way

play02:12

it does use the 32bit DSN this is just

play02:16

makes it a little bit easier to find all

play02:18

this and get it set up so first thing

play02:20

we're going to do is we're going to give

play02:22

us a DSN definition name so for my DSN

play02:28

definition name I'm it's going to use

play02:30

SQL

play02:32

2019 uncore

play02:35

Dore

play02:37

name now I do not have a DSN created yet

play02:42

so I'm going to hit this plus to add a

play02:45

DSN this stops us from having to

play02:47

configure this within windows so I'm

play02:50

going to come down here I'm going tell I

play02:51

want to use a system data

play02:53

source I'm going to select the one I

play02:55

want to use which is SQL in our

play02:57

case click finish

play03:00

and now I've got to give it a name and

play03:02

in my case I'm just going to name it SQL

play03:05

2019

play03:08

DSN the server in my case is SQL 2019

play03:13

that is the name of my SQL Server that

play03:15

I'm going to be connecting to click

play03:19

next I'm going to use the SQL Server

play03:22

authentication you may choose to set

play03:24

Yours up

play03:26

differently and use a Windows

play03:28

authentication but I'm going to use SQL

play03:30

Server authentication I want to change

play03:32

it to the default database that I know

play03:34

I'm trying to work against which is this

play03:36

ESC test it is the one that contains

play03:38

that table that I showed you a few

play03:39

minutes ago click next and I'm going to

play03:42

click finish and then I'm going to test

play03:44

this and I see I got a test connect

play03:46

completed successfully so that's

play03:48

important that we run that test that

play03:50

tells us this connection was able or

play03:53

dream report

play03:54

DSN has been created

play03:57

correctly okay now now at this point I

play04:01

actually got to go and select that after

play04:04

I created so that plus icon or the plus

play04:06

button all that did was launch the DSN

play04:08

Creator to create the DSN now I'm

play04:10

telling it my DSN definition name is

play04:13

going to use the one I just created I'm

play04:16

going to give it a log in again you may

play04:21

choose to do yours differently or yours

play04:24

may be different I'm just going to test

play04:26

this again so I'm seeing I got a

play04:28

completed test success Y and I'm just

play04:30

going to add it so now what I

play04:33

have is the SQL

play04:36

2019 DSN definition name it's an odbc

play04:40

and it uses the DSN SLE

play04:43

2019 DSN and using a sa login so at this

play04:48

point I just click okay and that part of

play04:51

it has been set up now that we have the

play04:54

DSN setup completed we're ready to jump

play04:58

right in to to creating the report

play05:02

because we don't need to configure a

play05:03

driver for this so I'm just going to

play05:07

right click tell it new report and I'm

play05:10

again I'm just going to take the default

play05:12

settings here we will have other videos

play05:14

that go through all how to configure all

play05:16

this report setup stuff and different

play05:18

ways you can do that but we're just

play05:19

going to do an apply and okay so what we

play05:22

need to do to begin with for the first

play05:25

way of doing this is we're going to set

play05:27

up a SQL statement that is permanently

play05:29

defined within dream report that we can

play05:32

reuse over and over again and the way we

play05:34

do that is with SQL manager up here at

play05:37

the top so if I click on that I've

play05:38

already got one defined and I'm just

play05:41

going to show you how that set up and

play05:42

then I'll set up another one but I've

play05:45

got it named SQL Mees query and I

play05:48

actually typed this SQL statement to run

play05:51

against that database now if you

play05:53

remember the database is a little EMS

play05:56

table that we defined and it's basically

play05:58

got our order number air product air

play06:00

quantity and the day time stamp now if

play06:02

you notice the default order the way

play06:04

this was entered into the database was

play06:06

soaps and then the candles was put in

play06:08

and that's matches up with the date time

play06:10

stamp on this particular one what I'm

play06:12

asking for the one I defined at this

play06:15

point in time was to query that data but

play06:18

do an sort on that data by the quantity

play06:21

in ascending order now the one I'm going

play06:23

to create is I'm going to create another

play06:26

SQL statement with in dream report and

play06:30

we're just going to call it SQL mes

play06:32

query 2 but I'm going to change this

play06:36

query statement to where it's going to

play06:37

be in a descending order based off of

play06:40

the quantity so I'm going to create one

play06:43

and that's basically all there is to it

play06:44

you give it a name and then you have to

play06:46

type the entire SQL statement whatever

play06:48

you want it to be because you can create

play06:51

and Define and build queries against

play06:53

databases the way you need to to make it

play06:56

for your application so it's probably I

play06:58

would say more power powerful than the

play07:00

other way we were doing it but it also

play07:02

requires a little bit more knowledge to

play07:04

be able to uh make this work so I'm

play07:06

going to say okay so now what I've got

play07:09

is I have two different ones remember

play07:11

this one is an ascending order and this

play07:13

is a descending order so now that we've

play07:15

got that defined I'm just going to go

play07:17

over here on my object and I'm going to

play07:19

do a SQL cury

play07:21

table and I'm G do that and at this

play07:25

point I gota give it that data source

play07:27

name which we defined earlier

play07:31

and now I'm going to choose an existing

play07:34

query and I'm going to choose the first

play07:37

one that I'd already created and I'm

play07:38

just going to add it and you can go into

play07:40

the appearance if you want to I would

play07:42

encourage you for what we're doing you

play07:44

notice it the FED with this sort being

play07:46

on always check this because dream

play07:49

report does this thing where it

play07:50

remembers previous configurations at

play07:53

least that's what I've seen with it and

play07:55

you're going to want to make sure that

play07:56

they're not going to interfere with what

play07:57

you're actually trying to do so I don't

play07:59

want this thing doing any sorting I'm

play08:01

I'm letting my SQL statement handle my

play08:04

sorting so I turn that off and then I'm

play08:05

going to say uh it's it's got in this

play08:08

instance you need to set it up to where

play08:10

it use Query directly click okay so

play08:13

that's the first one right so we should

play08:15

see the values listed off in an

play08:18

ascending order so we're going to create

play08:20

one

play08:21

more and this one we're going to again

play08:25

select the DSN name but we're going to

play08:28

use the second one I

play08:30

created again I'm going to check this

play08:33

sure enough to sort was on so I'm going

play08:35

to check that I'm going to make sure

play08:37

that when I pull this back it should be

play08:39

in descending order based off of this

play08:41

query statement say okay so now we're

play08:45

basically done and the key to this is uh

play08:48

when you're building out these reports

play08:50

using this method you won't be creating

play08:52

those query statements every time

play08:55

because they are built within dream

play08:58

report rep now are stored within dream

play09:00

report in the SQL manager and what I you

play09:03

saw me configure earlier so now I want

play09:05

to do run project yes I want to save

play09:08

this upload it to the runtime manager

play09:11

and then we're going to run the report

play09:13

and see the information come

play09:16

back okay so I'm going to do a generate

play09:18

report and I'm going to view

play09:20

it and sure enough you can see where the

play09:23

first one did the quantity in ascending

play09:25

order and the second one did the

play09:27

quantity in descending order so so

play09:29

that's one of the ways you can pull back

play09:31

data directly from the database using

play09:33

SQL statements okay with the second way

play09:36

of doing this we don't need two of these

play09:37

so I'm just going to delete one I'm

play09:39

delete that one again click on the uh

play09:42

SQL query

play09:45

table draw that out and on our data

play09:50

source again it's the same data source

play09:52

but this time we're not going to use a

play09:54

predefined query distored with in train

play09:56

reports we're going to type it out so

play09:59

there's this visual query Builder which

play10:02

is kind of pretty neat to be honest with

play10:04

you so if you you open it up once you to

play10:06

find that DSN it'll be able to look at

play10:08

that table I can click the table I want

play10:11

and then I can go through pick off the

play10:14

values I want returned I want you to

play10:17

sort the uh quantity sort type you know

play10:22

ascending descending whatever it may be

play10:24

if I click okay there or just click down

play10:28

here you'll see it says order msq

play10:31

data ascending when it says ascending

play10:34

there I could tell it descending and

play10:36

push the descending uh so you could do

play10:38

it like that or you could have just

play10:40

typed it in by hand we're going to go

play10:42

ahead and use this easy little Builder

play10:44

here now I will say this sometimes these

play10:46

queries can get a little complex

play10:49

uh kind of your your call on this how

play10:52

you want to handle it but we're going to

play10:53

go with this one to where it's just

play10:54

going to build it in descending order we

play10:56

just use a visual guey inside dream

play10:58

report be able to do it that should be

play11:00

all good and set up so I'm going to say

play11:02

okay I'm going to go to my appearances

play11:05

and again I want to turn this sort off

play11:07

because I want the sort being done over

play11:09

here I put the sort inside my query

play11:12

statement you could have done a where

play11:15

statement and actually done a filter on

play11:18

this and and we'll do some later videos

play11:20

about how to do that but again you're

play11:22

kind of you got a lot of power with this

play11:25

I can actually tell it to bring the data

play11:26

back where only the is greater than 100

play11:30

and then I could have Associated another

play11:33

field on my report to where I could have

play11:35

plugged in instead of it being defaulted

play11:37

at 100 I could have referenced it I

play11:39

could other words told dream report that

play11:41

I wanted it where it was greater than

play11:43

100 or think of a bat report where I

play11:45

just want to see certain batches brought

play11:48

back again you

play11:50

could have that a drop down box on the

play11:52

report you select the batch you want

play11:54

then it goes back and pulls all the

play11:55

associated values based off that batch

play11:58

so that that's how that stuff would

play12:00

would work out that's getting a little

play12:01

bit beyond what we're trying to show

play12:03

right here just trying to show how we

play12:05

can actually connect dream report to uh

play12:07

a relational database I've created this

play12:10

SQL statement using a uh the guy

play12:13

configuration so now we should be able

play12:15

to select okay and now we're ready to

play12:20

run this report so if I click R for it

play12:23

yeah do I want to save it yes I do it's

play12:25

uploading it to the runtime

play12:27

engine so now I'm going to do a

play12:31

generate

play12:33

report and then we're going to look at

play12:36

PDF and we can see we got it in

play12:38

descending order so that's the other way

play12:41

you can build a dream report report um

play12:44

with connected to SQL Server again two

play12:46

different ways of doing it I would say

play12:48

this is probably a little bit more

play12:49

advanced you got more capabilities with

play12:51

doing it this way versus the simple way

play12:53

that I've showed in previous video but

play12:56

as you can see dream report is fully

play12:58

capable communicating to databases in at

play13:00

least three different ways it does

play13:02

change licensing Model A little bit if

play13:05

you're going to be using a lot of what I

play13:07

just showed you here where you're

play13:08

actually generating SQL statements when

play13:11

you get your license in or look to

play13:12

purchase it you're going make sure you

play13:14

get the mees option because of tag count

play13:18

uh it will allow unlimited Mees queries

play13:21

uh the other way is actually going to

play13:23

bite into your tag count with dream

play13:26

report if you do it the simple way to

play13:28

showed in another video so you just kind

play13:30

of got to weigh that out let us know if

play13:32

this video was helpful by clicking the

play13:34

like button below if you want to learn

play13:37

more about dream report contact your

play13:39

local es&

play13:43

[Music]

play13:51

representative

Rate This

5.0 / 5 (0 votes)

相关标签
Data VisualizationSQL ServerDream ReportReporting ToolData IntegrationSQL QueriesODBC DSNData SourceDatabase ConnectionSort Order
您是否需要英文摘要?