A problem with a report...

D

Dwayne Conyers

We have a drop-down that is populated with a list of items... selecting one
item creates a report that is attached to an e-mail. We tested this and
everything seems to work except the second page of the exported RTF file is
blank... the header and footer info is there but the detail is blank.

When we view the RTF in design-time, we see both pages of data. The event
code appears below.


<!--

Private Sub Combo7_BeforeUpdate(Cancel As Integer)

foo = Combo7.Value
bar = "Select Report from Record # " & Trim(Str(foo))

newSQL = "SELECT [DHS Reports].*, Agency_Codes.Agency,
Report_Types.report_type INTO temp " & _
"FROM ([DHS Reports] LEFT JOIN Report_Types ON [DHS
Reports].Report_Type_Key = Report_Types.rpt_type_id) LEFT JOIN Agency_Codes
ON [DHS Reports].Agency_Code_Key = Agency_Codes.ag_cd_id " & _
"WHERE ((([DHS Reports].ID)=" & Trim(Str(foo)) & "));"

DoCmd.RunSQL newSQL

DoCmd.SendObject acOutputReport, "e-mail", acFormatRTF

End Sub


//-->
 
A

Alick [MSFT]

Hi Dwayne,

Does the data appear when you open the report directly within Access
database? How do you view the RTF in design-time? Usually we use Word to
open the RTF file, the RTF file is created as an attachment in an email
when we run DoCmd.SendObject. it seems you dynamically create a table
"temp", is this table the data source of the report "e-mail"? If you
simplify the data source of the report, does the issue occur?



Sincerely,

Alick Ye, MCSD
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.






--------------------
| Reply-To: "Dwayne Conyers" <[email protected]>
| From: "Dwayne Conyers" <[email protected]>
| Subject: A problem with a report...
|
| We have a drop-down that is populated with a list of items... selecting
one
| item creates a report that is attached to an e-mail. We tested this and
| everything seems to work except the second page of the exported RTF file
is
| blank... the header and footer info is there but the detail is blank.
|
| When we view the RTF in design-time, we see both pages of data. The event
| code appears below.
|
|
| <!--
|
| Private Sub Combo7_BeforeUpdate(Cancel As Integer)
|
| foo = Combo7.Value
| bar = "Select Report from Record # " & Trim(Str(foo))
|
| newSQL = "SELECT [DHS Reports].*, Agency_Codes.Agency,
| Report_Types.report_type INTO temp " & _
| "FROM ([DHS Reports] LEFT JOIN Report_Types ON [DHS
| Reports].Report_Type_Key = Report_Types.rpt_type_id) LEFT JOIN
Agency_Codes
| ON [DHS Reports].Agency_Code_Key = Agency_Codes.ag_cd_id " & _
| "WHERE ((([DHS Reports].ID)=" & Trim(Str(foo)) & "));"
|
| DoCmd.RunSQL newSQL
|
| DoCmd.SendObject acOutputReport, "e-mail", acFormatRTF
|
| End Sub
|
|
| //-->
|
|
| --
| dwacon
| www.dwacon.com
|
|
|
 
D

Dwayne Conyers

We use a temp table because we are looking at one specific record and
pulling data from joined tables. More RDBMS functionality which Access
seems limited in... but it worked for us on a similar project.

We don't view the RTF in design-time, we created a snapshot to see how the
formatted report should look (opening the report object directly) -- so I
wasn't clear there.

The RTF is created as an attachment to the e-mail and when we sent the
e-mail to a member of the dev team it opened with the first page containing
data and the second page blank.

We can't change the data source as this is customer requirement.

Thanks.
 
A

Alick [MSFT]

Hi Dwayne,

We may need to narrow down if the problem happens before you send the email
to the member, so save the rft attachment file to your local disk and open
it in the way as the client does (does the client open it in snapshot
view?), is the second page blank? If the second page is not blank on your
local computer, there could be some transfer issue? If it is originally
blank before sending it to the client, check if there is any data missing
or it just adds an extra blank page. Since you can't change the data
source, you can simply create a sample to test if the issue is caused by
Access components or it is related to the specific data/source or the
report is corrupt?

I did a simple test on sample database NorthWind.mdb, all work well.

Option Compare Database
Option Explicit

Private Sub Command7_Click()

Dim newsql As String

newsql = "select CompanyName into temp from customers"

DoCmd.RunSQL newsql

DoCmd.SendObject acOutputReport, "rptemp", acFormatRTF

End Sub

Note: report rptemp is created by Wizard based on the table temp.

Please feel free to reply to the threads so we can continue work on this
problem.



Sincerely,

Alick Ye, MCSD
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Reply-To: "Dwayne Conyers" <[email protected]>
| From: "Dwayne Conyers" <[email protected]>
| References: <#[email protected]> <5hoCrDngDHA.2188
|
| We use a temp table because we are looking at one specific record and
| pulling data from joined tables. More RDBMS functionality which Access
| seems limited in... but it worked for us on a similar project.
|
| We don't view the RTF in design-time, we created a snapshot to see how the
| formatted report should look (opening the report object directly) -- so I
| wasn't clear there.
|
| The RTF is created as an attachment to the e-mail and when we sent the
| e-mail to a member of the dev team it opened with the first page
containing
| data and the second page blank.
|
| We can't change the data source as this is customer requirement.
|
| Thanks.
|
|
| | > Hi Dwayne,
| >
| > Does the data appear when you open the report directly within Access
| > database? How do you view the RTF in design-time? Usually we use Word to
| > open the RTF file, the RTF file is created as an attachment in an email
| > when we run DoCmd.SendObject. it seems you dynamically create a table
| > "temp", is this table the data source of the report "e-mail"? If you
| > simplify the data source of the report, does the issue occur?
| >
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Microsoft Online Partner Support
| >
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| >
| >
| >
| >
| >
| > --------------------
| > | Reply-To: "Dwayne Conyers" <[email protected]>
| > | From: "Dwayne Conyers" <[email protected]>
| > | Subject: A problem with a report...
| > |
| > | We have a drop-down that is populated with a list of items...
selecting
| > one
| > | item creates a report that is attached to an e-mail. We tested this
and
| > | everything seems to work except the second page of the exported RTF
file
| > is
| > | blank... the header and footer info is there but the detail is blank.
| > |
| > | When we view the RTF in design-time, we see both pages of data. The
| event
| > | code appears below.
| > |
| > |
| > | <!--
| > |
| > | Private Sub Combo7_BeforeUpdate(Cancel As Integer)
| > |
| > | foo = Combo7.Value
| > | bar = "Select Report from Record # " & Trim(Str(foo))
| > |
| > | newSQL = "SELECT [DHS Reports].*, Agency_Codes.Agency,
| > | Report_Types.report_type INTO temp " & _
| > | "FROM ([DHS Reports] LEFT JOIN Report_Types ON [DHS
| > | Reports].Report_Type_Key = Report_Types.rpt_type_id) LEFT JOIN
| > Agency_Codes
| > | ON [DHS Reports].Agency_Code_Key = Agency_Codes.ag_cd_id " & _
| > | "WHERE ((([DHS Reports].ID)=" & Trim(Str(foo)) & "));"
| > |
| > | DoCmd.RunSQL newSQL
| > |
| > | DoCmd.SendObject acOutputReport, "e-mail", acFormatRTF
| > |
| > | End Sub
| > |
| > |
| > | //-->
| > |
| > |
|
|
|
 
D

Dwayne Conyers

Alick

After extensive testing and debugging, the problem seems to be with
exporting to RTF format. RTF has missing data and also the header appears
in the middle of Page 2 of a multi-page report and slightly off on Page 3.

When we export to HTML format, we get a little more data than the RTF shows,
but it still cuts off the data and mis-formats the header and footer.

When we choose snapshot as the modality, it works fine. However, the client
requests RTF as the first choice, HTML as an alternate, but does not want
snapshots.

Any other ideas? Thanks.



Alick said:
Hi Dwayne,

We may need to narrow down if the problem happens before you send the email
to the member, so save the rft attachment file to your local disk and open
it in the way as the client does (does the client open it in snapshot
view?), is the second page blank? If the second page is not blank on your
local computer, there could be some transfer issue? If it is originally
blank before sending it to the client, check if there is any data missing
or it just adds an extra blank page. Since you can't change the data
source, you can simply create a sample to test if the issue is caused by
Access components or it is related to the specific data/source or the
report is corrupt?

I did a simple test on sample database NorthWind.mdb, all work well.

Option Compare Database
Option Explicit

Private Sub Command7_Click()

Dim newsql As String

newsql = "select CompanyName into temp from customers"

DoCmd.RunSQL newsql

DoCmd.SendObject acOutputReport, "rptemp", acFormatRTF

End Sub

Note: report rptemp is created by Wizard based on the table temp.

Please feel free to reply to the threads so we can continue work on this
problem.



Sincerely,

Alick Ye, MCSD
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Reply-To: "Dwayne Conyers" <[email protected]>
| From: "Dwayne Conyers" <[email protected]>
| References: <#[email protected]> <5hoCrDngDHA.2188
|
| We use a temp table because we are looking at one specific record and
| pulling data from joined tables. More RDBMS functionality which Access
| seems limited in... but it worked for us on a similar project.
|
| We don't view the RTF in design-time, we created a snapshot to see how the
| formatted report should look (opening the report object directly) -- so I
| wasn't clear there.
|
| The RTF is created as an attachment to the e-mail and when we sent the
| e-mail to a member of the dev team it opened with the first page
containing
| data and the second page blank.
|
| We can't change the data source as this is customer requirement.
|
| Thanks.
|
|
| | > Hi Dwayne,
| >
| > Does the data appear when you open the report directly within Access
| > database? How do you view the RTF in design-time? Usually we use Word to
| > open the RTF file, the RTF file is created as an attachment in an email
| > when we run DoCmd.SendObject. it seems you dynamically create a table
| > "temp", is this table the data source of the report "e-mail"? If you
| > simplify the data source of the report, does the issue occur?
| >
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Microsoft Online Partner Support
| >
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| >
| >
| >
| >
| >
| > --------------------
| > | Reply-To: "Dwayne Conyers" <[email protected]>
| > | From: "Dwayne Conyers" <[email protected]>
| > | Subject: A problem with a report...
| > |
| > | We have a drop-down that is populated with a list of items...
selecting
| > one
| > | item creates a report that is attached to an e-mail. We tested this
and
| > | everything seems to work except the second page of the exported RTF
file
| > is
| > | blank... the header and footer info is there but the detail is blank.
| > |
| > | When we view the RTF in design-time, we see both pages of data. The
| event
| > | code appears below.
| > |
| > |
| > | <!--
| > |
| > | Private Sub Combo7_BeforeUpdate(Cancel As Integer)
| > |
| > | foo = Combo7.Value
| > | bar = "Select Report from Record # " & Trim(Str(foo))
| > |
| > | newSQL = "SELECT [DHS Reports].*, Agency_Codes.Agency,
| > | Report_Types.report_type INTO temp " & _
| > | "FROM ([DHS Reports] LEFT JOIN Report_Types ON [DHS
| > | Reports].Report_Type_Key = Report_Types.rpt_type_id) LEFT JOIN
| > Agency_Codes
| > | ON [DHS Reports].Agency_Code_Key = Agency_Codes.ag_cd_id " & _
| > | "WHERE ((([DHS Reports].ID)=" & Trim(Str(foo)) & "));"
| > |
| > | DoCmd.RunSQL newSQL
| > |
| > | DoCmd.SendObject acOutputReport, "e-mail", acFormatRTF
| > |
| > | End Sub
| > |
| > |
| > | //-->
| > |
| > |
|
|
|
 
A

Alick [MSFT]

Hi Dwayne,

According to my research, the Rich Text Format does not interpret certain
objects or properties from an Access report, this is the reason sometimes
the format is missing. Format loss when exporting a report is a common
issue due to the way some of the formats interpret the report design. The
RTF format is where we see a majority of the issues, and resolving these
format losses can be labor intensive on the evelopers part. Because of
these format losses, we designed the Snapshot format (.SNP) to allow
reports to keep their formatting and remain in the same design. The
snapshot file is the only one that will retain the report format, including
the bitmap pictures. We can use Snapshot Viewer to view the snp file.

In this case, we may try outputto method to see if it makes any difference
for this specific issue/report, you may refer to the article 130867 to
modify some design in the report to furthest prevent data from missing.

ACC: Tips to Design Reports for Output to RTF File
http://support.microsoft.com/support/kb/articles/Q130/8/57.asp

ACC2000: Text in Saved Report File Is Wrapped Differently
http://support.microsoft.com/support/kb/articles/Q208/8/75.asp

ACC97: Memo Field Exported to RTF Format May Be Truncated
http://support.microsoft.com/support/kb/articles/Q288/8/77.asp


Please feel free to reply to the threads if you have any concerns or
questions.



Sincerely,

Alick Ye, MCSD
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Reply-To: "Dwayne Conyers" <[email protected]>
| From: "Dwayne Conyers" <[email protected]>
| References: <#[email protected]> <5hoCrDngDHA.2188
|
| Alick
|
| After extensive testing and debugging, the problem seems to be with
| exporting to RTF format. RTF has missing data and also the header appears
| in the middle of Page 2 of a multi-page report and slightly off on Page 3.
|
| When we export to HTML format, we get a little more data than the RTF
shows,
| but it still cuts off the data and mis-formats the header and footer.
|
| When we choose snapshot as the modality, it works fine. However, the
client
| requests RTF as the first choice, HTML as an alternate, but does not want
| snapshots.
|
| Any other ideas? Thanks.
|
|
|
| | > Hi Dwayne,
| >
| > We may need to narrow down if the problem happens before you send the
| email
| > to the member, so save the rft attachment file to your local disk and
open
| > it in the way as the client does (does the client open it in snapshot
| > view?), is the second page blank? If the second page is not blank on
your
| > local computer, there could be some transfer issue? If it is originally
| > blank before sending it to the client, check if there is any data
missing
| > or it just adds an extra blank page. Since you can't change the data
| > source, you can simply create a sample to test if the issue is caused by
| > Access components or it is related to the specific data/source or the
| > report is corrupt?
| >
| > I did a simple test on sample database NorthWind.mdb, all work well.
| >
| > Option Compare Database
| > Option Explicit
| >
| > Private Sub Command7_Click()
| >
| > Dim newsql As String
| >
| > newsql = "select CompanyName into temp from customers"
| >
| > DoCmd.RunSQL newsql
| >
| > DoCmd.SendObject acOutputReport, "rptemp", acFormatRTF
| >
| > End Sub
| >
| > Note: report rptemp is created by Wizard based on the table temp.
| >
| > Please feel free to reply to the threads so we can continue work on this
| > problem.
| >
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Microsoft Online Partner Support
| >
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | Reply-To: "Dwayne Conyers" <[email protected]>
| > | From: "Dwayne Conyers" <[email protected]>
| > | References: <#[email protected]> <5hoCrDngDHA.2188
| > |
| > | We use a temp table because we are looking at one specific record and
| > | pulling data from joined tables. More RDBMS functionality which
Access
| > | seems limited in... but it worked for us on a similar project.
| > |
| > | We don't view the RTF in design-time, we created a snapshot to see how
| the
| > | formatted report should look (opening the report object directly) --
so
| I
| > | wasn't clear there.
| > |
| > | The RTF is created as an attachment to the e-mail and when we sent the
| > | e-mail to a member of the dev team it opened with the first page
| > containing
| > | data and the second page blank.
| > |
| > | We can't change the data source as this is customer requirement.
| > |
| > | Thanks.
| > |
| > |
| > | | > | > Hi Dwayne,
| > | >
| > | > Does the data appear when you open the report directly within Access
| > | > database? How do you view the RTF in design-time? Usually we use
Word
| to
| > | > open the RTF file, the RTF file is created as an attachment in an
| email
| > | > when we run DoCmd.SendObject. it seems you dynamically create a
table
| > | > "temp", is this table the data source of the report "e-mail"? If you
| > | > simplify the data source of the report, does the issue occur?
| > | >
| > | >
| > | >
| > | > Sincerely,
| > | >
| > | > Alick Ye, MCSD
| > | > Microsoft Online Partner Support
| > | >
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | >
| > | >
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | Reply-To: "Dwayne Conyers" <[email protected]>
| > | > | From: "Dwayne Conyers" <[email protected]>
| > | > | Subject: A problem with a report...
| > | > |
| > | > | We have a drop-down that is populated with a list of items...
| > selecting
| > | > one
| > | > | item creates a report that is attached to an e-mail. We tested
this
| > and
| > | > | everything seems to work except the second page of the exported
RTF
| > file
| > | > is
| > | > | blank... the header and footer info is there but the detail is
| blank.
| > | > |
| > | > | When we view the RTF in design-time, we see both pages of data.
The
| > | event
| > | > | code appears below.
| > | > |
| > | > |
| > | > | <!--
| > | > |
| > | > | Private Sub Combo7_BeforeUpdate(Cancel As Integer)
| > | > |
| > | > | foo = Combo7.Value
| > | > | bar = "Select Report from Record # " & Trim(Str(foo))
| > | > |
| > | > | newSQL = "SELECT [DHS Reports].*, Agency_Codes.Agency,
| > | > | Report_Types.report_type INTO temp " & _
| > | > | "FROM ([DHS Reports] LEFT JOIN Report_Types ON [DHS
| > | > | Reports].Report_Type_Key = Report_Types.rpt_type_id) LEFT JOIN
| > | > Agency_Codes
| > | > | ON [DHS Reports].Agency_Code_Key = Agency_Codes.ag_cd_id " & _
| > | > | "WHERE ((([DHS Reports].ID)=" & Trim(Str(foo)) &
"));"
| > | > |
| > | > | DoCmd.RunSQL newSQL
| > | > |
| > | > | DoCmd.SendObject acOutputReport, "e-mail", acFormatRTF
| > | > |
| > | > | End Sub
| > | > |
| > | > |
| > | > | //-->
| > | > |
| > | > |
| > |
| > |
| > |
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top