.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Query report text

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
chase.hochstrasser
529 Views, 2 Replies

Query report text

I would like to create a text file with from a report. here is my code so far....

 

                    '' Clear the existing Query
                    Dim qryModel As QueryModel = proj.CreateQuery()
                    qryModel.Clear()

                    Dim qryBranch As New QueryBranch(Constants.JoinOperator.OperatorAnd)

                    '' Property Condition
                    Dim propertyCondition As PropertyCondition = New PropertyCondition
                    propertyCondition.JoinOperator = Constants.JoinOperator.OperatorAnd
                    propertyCondition.PropertyType = Constants.PropertyType.Layer
                    propertyCondition.ConditionOperator = Constants.ConditionOperator.ConditionEqual
                    propertyCondition.Value = "CP*"
                    qryBranch.AppendOperand(propertyCondition)
                    qryModel.Define(qryBranch)
                    qryModel.Mode = Constants.QueryType.QueryReport
                    qryModel.ReportTemplate.AddLine(":CIRCUIT@CIRCUIT")
                    qryModel.ReportTemplate.AddLine(".DWGNAME")
                    qryModel.Execute(dwgSet)
                    qryModel.Run()

 can you help me to send data to a text file?

2 REPLIES 2
Message 2 of 3

Hi,

 

is that the line you are missing (based on your code):

 

      'last lines based on your code (after adding .DWGNAME):

      'define your output file

      qryModel.ReportTemplate.FileName = "C:\TEMP\ReportResult.TXT"

      'removed ... qryModel.Execute(dwgSet)

      qryModel.Run()

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3

Correct! Thanks again.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost