I'm trying to export Revit data to an external database. What I'm looking for is to use RevitAPI to do the job of exporting. Though if there is a way to do so using Revit's own tools it'll be fine. As long as I can choose and modify the columns in exported tables.
Does anybody have any suggestions?
I've already tried "Revit > Export > ODBC", but this option only exports some default parameters and I can not modify the columns I want in my tables.
I'm also aware of Revit DB Link. It is for subscribed users only so that's not an option here.
You can implement an Revit add-in to access the data you require from the Revit database and manipulate that into the form you require for export. For the actual connection to the external SQL database, you will have to use some additional library. For that, I would suggest searching the Internet for something like sql server .net api.
Related
I have a report template which is built in Power BI Desktop and is saved as .pbix or .pbit file. This template uses DirectQuery SQL database as data source, whereas server address and database name are extracted to parameters. There is also a parameter which holds a ReportId, which is used in queries.
I also have a C# application, which is supposed to generate Power BI Desktop reports from this template.
How can create a report with specific parameters programmatically?
Something like Power BI Desktop does itself when you open .pbit template file, enter parameters and it generates .pbix document.
I didn't find any SDK \ Interop libraries for Power BI Desktop.
I have tried to open a document as ZIP, but DataModel file is archived, and therefore not a well-formed XML.
I have also tried to extract this parameters to JSON file and load it as a data source, but relative paths are not supported by Power BI.
There is no SDK or API you can use to do that. If you publish this report to Power BI Online, you can use Update Parameters and Update Parameters In Group REST API calls to change the parameter values. I believe Power BI Reporting Server has similar API, but I do not have experience with it.
You could try to publish the report online and keep it there (it is not needed to share it with anyone). When you need a report with some parameter value, call the API methods above to change the value, and then download the modified .pbix file using Export Report or Export Report In Group methods. It's ugly and not thread safe, but may work...
You said you looked at DataModel file in the extracted .pbix. I think the parameters and M queries are in DataMashup (search for RootFormulaText or ReferencedQueriesFormulaText text to find them). The server and database names are also there. You can relatively easy modify the M query, the value of existing parameter or server/database name, and try to re-pack the .pbix file. It may work, but looks extremely unsupported.
I tried to connect with SSMS to the report's SSAS in Power BI Desktop, but I didn't find a way to modify parameter value this way. I can see their values in the source queries, though (if the parameter is used as a filter).
I'm using something similar, but instead of parameters, I'm embedding the report in my application and use filters. This way all users access one and the same report and I do not need to "tailor" the .pbix for their specific needs.
I'm afraid this isn't an answer that will solve your problem, but I hope it will give you some ideas what you can or can't do!
I use Visual Studio with SAP Business One SDK.
In this example I used a GridView and a simple select on the POR1 table but what I would like to do is that when I fill in a GridView or a matrix what I write registers in the database so in the table por1, I made the example on both fields in the red frame (Photo Attachment).
Please, what do I do so that what I write here is stored in the database in the table por1 and in the fields U_QtyEnCours and U_StatutMarch?
There's a few ways to do this.
The first is using a direct SQL write - this is the fastest and is allowed for UDFs, but may be frowned upon depending on who your SAP Partner is. You also won't get any History logging.
You can use the SAP-DI Documents object to iterate over the Purchase Orders, and update the lines one by one - this is logged, but can be slow.
You could also just export it to a file and update it using the Data Transfer Workbench (DTW) which is logged, and also has all the error handling built in.
I'm busy writing a small app and I only want a database to load small amounts of data, in other words I don't need the functionality of SQL.
So I've installed filehelpers, but it seems very limited in the sense that I can read/write and even append data, but it seem impossible to delete one row of data in a table?
Does anyone know how to do this with filehelpers or point me to a different solution where I can just add a local db to my app without any other external software required?
PS. My visual studio does not have the "create local db" from the item selection.
For something like this, I'd use an embedded SQLite database. It gives you the best of both worlds, one file database for local data and most of the features of SQL.
See here: https://sqlite.org/
On their download page, they have lots of stuff and a plugin for VS:
https://sqlite.org/download.html
I have about 5000 csv file and I want to insert them in a sql server 2008 database.
I don't whether windows application or web application is better.
each csv file is simple a one row with 36 column that will be inserted in an one table in the database.
thanks for your help.
Update 1
This application will be used on a computer that can connect to the database, it is used by the admin just once, in order words, there are people who responsible to write these csv files, then all the files, come to me and I have to insert them in the database
Update 2
Thanks for the user who are trying to help me.
You gave me these options:
bcp
SqlBulkCopy
Windows service
what is the best please? I told you all the requirements, which are very simple.
Depends how you want to use it - if you want to deploy to lots of people so they can upload a file and process it into a database, make it web.
If on the other hand, you only have a couple of users which you can easily deploy an app to, there is a lot less infrastructure required to write it as an app.
Sounds to me, you want to automate the mass loading of lots of files, so windows app is jumping out at me.
All depends on what the overall requirements are.
Based on your edit, write a win app that uses a folder enumeration, reads the records and passes to a SqlBulkCopy object.
based on your comment I would take an aproach like that:
Easy to use gui solution:
1. Make a website for people that are making the csv's
That website would preform and check's that are necesery and display any errors. Error checking is done by the Web service (more future proven imo).
Create a webservice importing the file to database and sending you an email. That way you don't have any work with putting the data into the database
Implement an aproveal mechanism so you need to aprove the new inputs to the database if needed
Easy to implement solution:
Create an application (Console/WinForm/Web) that uses the bcp tool to import the data and handles errors
I am working on Windows Forms Application with SQL Server Database. Now I have to convert the SQL Database to MS Access database as per the requirement. Can any one help me out
how to convert SQL database to MS access database so that, I can access the same tables.
Thanks & Regards,
Vani.
You can use MS SQL management studio to export tables data and structure to access. To do this right click on you db in Management studio and select Tasks -> Export data. Now follow the steps of the wizard. First you'll select the source - it would be you db, next destination - it would be an access file. And there you go :) Have fun!
As Elastep says, you can export data from MS SQL Management Studio - but that will only get you to .MDB-files; ie. prior to Access 2007. The steps below works both for 2007 and prior (although the actual path to execute them may vary in the different versions):
In Access you can import the tables from SQL Server - when in your target database in Access, choose External Data --> More --> ODBC Database. In there you can set up a connection to the SQL Server and choose between Import the source data and Link to the datasource. After selecting either, you can choose the tables you wish to import/link.
If you import, the data will be copied physically to the Access-file. It sounds like this is what you want to achieve.
However, as comments above suggest, this sounds off. Are you sure you want to move your data to a weaker engine? If you do want to keep the data in the SQL Server, whilst using Access only for forms, etc. you can link the tables instead. This way, you can use the rapid-prototyping, datacentric tools in Access, while keeping the security, consistency and scalability of the SQL Server.
For reference, you might want to take a look at this: http://office.microsoft.com/en-us/access-help/import-or-link-to-sql-server-data-HA010200494.aspx